Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

stepanblyschak
Copy link
Owner

@stepanblyschak stepanblyschak commented Jul 18, 2024

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

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311
  • 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)

@@ -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 \

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?

Copy link
Owner Author

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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stepanblyschak local -r ?

Copy link
Owner Author

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() {

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?

Copy link
Owner Author

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]>
stepanblyschak pushed a commit that referenced this pull request Aug 22, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants