perf: move runtime state files from SD card to tmpfs#751
Open
winstar0070 wants to merge 1 commit intosipeed:mainfrom
Open
perf: move runtime state files from SD card to tmpfs#751winstar0070 wants to merge 1 commit intosipeed:mainfrom
winstar0070 wants to merge 1 commit intosipeed:mainfrom
Conversation
Move frequently-written runtime state files (now_fps, state, wifi_state, width, height) from /kvmapp/kvm/ to /tmp/kvm/ to minimize SD card writes and extend SD card lifespan. now_fps is written every 3 seconds, causing ~86K+ writes/day. User settings (fps, qlty, res, type) remain on /kvmapp/kvm/ as they need to persist across reboots.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
now_fps,state,wifi_state,width,height) from/kvmapp/kvm/to/tmp/kvm/(tmpfs) to minimize SD card writes and extend SD card lifespannow_fpsalone causes ~86,400+ writes/day (written every 3 seconds), significantly contributing to SD card wearfps,qlty,res,type) remain on/kvmapp/kvm/as they need to persist across rebootsRelated: #708, #701
Changes
now_fps/kvmapp/kvm/now_fps→/tmp/kvm/now_fpsstate/kvmapp/kvm/state→/tmp/kvm/statewifi_state/kvmapp/kvm/wifi_state→/tmp/kvm/wifi_statewidth/height/kvmapp/kvm/{width,height}→/tmp/kvm/{width,height}Files modified (8 files)
server/service/stream/frame_rate.go— now_fps write pathserver/service/network/wifi.go— WiFiStateFile constantsupport/sg2002/kvm_system/main/lib/system_init/system_init.cpp— addmkdir -p /tmp/kvm+ update init pathssupport/sg2002/kvm_system/main/lib/system_state/system_state.cpp— update read/write pathssupport/sg2002/kvm_system/main/lib/hdmi/hdmi.cpp— update width/height write pathssupport/sg2002/additional/kvm/src/kvm_vision.cpp— update defines + state write pathssupport/sg2002/additional/sophgo-middleware/v2/sample/common/sample_common_sensor.c— update width/height read pathssupport/sg2002/kvm_system/main/include/config.h— update commentsTest plan
/tmp/kvm/directory and files are created on bootcat /tmp/kvm/now_fps/tmp/kvm/widthand/tmp/kvm/heightupdate on HDMI connect/disconnect/tmp/kvm/wifi_statetransitions on WiFi connect/disconnect/tmp/kvm/statechanges on camera stream start/stopfps,qlty,res,type) persist after reboot/tmpis mounted as tmpfs:mount | grep tmpfs | grep /tmp