-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[finalize-warmboot.sh] reset cpufreq governor to default #126
Conversation
Signed-off-by: Stepan Blyschak <[email protected]>
ef1b3d8
to
51ef6a2
Compare
@@ -101,16 +101,30 @@ function check_list() | |||
echo ${RET_LIST} | |||
} | |||
|
|||
function set_cpufreq_governor() { | |||
governor="$1" | |||
echo "$governor" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stepanblyschak tee stdout
is redundant. Can we hide it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nazariig done
@@ -101,16 +101,30 @@ function check_list() | |||
echo ${RET_LIST} | |||
} | |||
|
|||
function set_cpufreq_governor() { | |||
governor="$1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stepanblyschak local -r
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nazariig done
@@ -101,16 +101,30 @@ function check_list() | |||
echo ${RET_LIST} | |||
} | |||
|
|||
function set_cpufreq_governor() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stepanblyschak do we need to add a check that if current CPU governor is not equal to what we set then proceed, otherwise - exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nazariig don't see a benefit from such check
Signed-off-by: Stepan Blyschak <[email protected]>
…utomatically (sonic-net#19920) #### Why I did it src/sonic-host-services ``` * d62c874 - (HEAD -> 202311, origin/202311) Added a try block to prevent JSON decoder errors (#126) (10 hours ago) [Ashwin Srinivasan] ``` #### How I did it #### How to verify it #### Description for the changelog
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
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:
After boot is finalized check that it is reset back to default:
Which release branch to backport (provide reason below if selected)
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)