You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fw/services/settings: speed up file rewrite, pause watchdog
settings_file_rewrite_filtered runs under a held mutex while issuing
flash erases and writes that, on a 1 MiB persist file, can take many
seconds. Once the per-app cap was raised the rewrite started tripping
the 5-second task watchdog and triggering App Throttling. FIRM-1649
flagged this; it didn't matter at the old 6 KiB cap.
Three changes:
- Pause the task watchdog for the duration of the rewrite (60 s
budget, comfortably covers a worst-case 1 MiB rewrite). Same pattern
already used during boot in main.c.
- Add settings_raw_iter_read_key_val / write_key_val helpers that
read or write the key and value as a single contiguous PFS call.
Drops per-record I/O from 6 PFS round-trips (separate header, key,
val) to 4, which on a file with thousands of records saves a few
hundred ms of seek/read state-machine overhead.
- Allocate one reusable buffer outside the rewrite loop instead of
two kernel_malloc/kernel_free pairs per record.
Flash erase and program time still dominate, so this doesn't make
small rewrites feel different, but the watchdog pause keeps big
rewrites from triggering throttle/recovery storms in the logs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Joshua Jun <lets@throw.rocks>
0 commit comments