sonic-buildimage
sonic-buildimage copied to clipboard
[finalize-warmboot.sh] reset cpufreq governor to default
Why I did it
Set cpufreq.default_governor to performance for faster boot time. We observe consistent 1 sec improvement across several devices.
The change in finalize-warmboot.sh restores the default governor after fast or warm boot is finished.
NOTE: This will apply to upgrades starting from 202405 since this is set in shutdown path to avoid any extra scripts running at boot time. Upgrade from older versions/branches will require a runtime patch to fast-reboot and warm-reboot script.
Work item tracking
- Microsoft ADO (number only):
How I did it
After fast or warm boot is finished restore to default governor.
How to verify it
Run fast-reboot or warm-reboot. Check:
admin@sonic:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
performance
After boot is finalized check that it is reset back to default:
admin@sonic:~$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
schedutil
Tested with https://github.com/sonic-net/sonic-utilities/pull/3435
Which release branch to backport (provide reason below if selected)
- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305
- [ ] 202311
- [x] 202405
Tested branch (Please provide the tested image version)
- [ ]
- [ ]
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)
@saiarcot895 @vaibhavhd Can you please help review?
@vaibhavhd kindly reminder for code review feedback/approval.
Comments are open on utilities PR.
/azpw run Azure.sonic-buildimage
/AzurePipelines run Azure.sonic-buildimage
Azure Pipelines successfully started running 1 pipeline(s).
@qiluo-msft can you please help merge?
@stepanblyschak Can you raise a PR to 202405 to do the cherry-pick? The auto cherry-pick is not working for this PR.
Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-buildimage/pull/21030