sonic-buildimage icon indicating copy to clipboard operation
sonic-buildimage copied to clipboard

[finalize-warmboot.sh] reset cpufreq governor to default

Open stepanblyschak opened this issue 1 year ago • 3 comments

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)

stepanblyschak avatar Jul 19 '24 07:07 stepanblyschak

@saiarcot895 @vaibhavhd Can you please help review?

bingwang-ms avatar Aug 26 '24 21:08 bingwang-ms

@vaibhavhd kindly reminder for code review feedback/approval.

liat-grozovik avatar Sep 03 '24 08:09 liat-grozovik

Comments are open on utilities PR.

vaibhavhd avatar Sep 09 '24 16:09 vaibhavhd

/azpw run Azure.sonic-buildimage

stepanblyschak avatar Oct 16 '24 10:10 stepanblyschak

/AzurePipelines run Azure.sonic-buildimage

mssonicbld avatar Oct 16 '24 10:10 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Oct 16 '24 10:10 azure-pipelines[bot]

@qiluo-msft can you please help merge?

dgsudharsan avatar Nov 04 '24 17:11 dgsudharsan

@stepanblyschak Can you raise a PR to 202405 to do the cherry-pick? The auto cherry-pick is not working for this PR.

bingwang-ms avatar Dec 04 '24 17:12 bingwang-ms

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-buildimage/pull/21030

mssonicbld avatar Dec 04 '24 18:12 mssonicbld