-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #19634
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,16 +101,30 @@ function check_list() | |
echo ${RET_LIST} | ||
} | ||
|
||
function set_cpufreq_governor() { | ||
local -r governor="$1" | ||
echo "$governor" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 1> /dev/null \ | ||
&& debug "Set CPUFreq scaling governor to $governor" \ | ||
|| debug "Failed to set CPUFreq scaling governor to $governor" | ||
} | ||
|
||
function finalize_common() { | ||
# Read default governor from kernel config | ||
local -r default_governor=$(cat "/boot/config-$(uname -r)" | grep -o 'CONFIG_CPU_FREQ_DEFAULT_GOV_[^=]*=y') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the guarantee that Do you need to sanity check on the value and type of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's part of our sonic linux kernel config, why would we remove it or set it to invalid value? |
||
set_cpufreq_governor "$default_governor" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The utilities change is made for MLNX platforms only. I think it would be best to make this call only for MLNX platforms as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @vaibhavhd I applied your suggestion. While testing that modification found that the | grep is incorrect causing governor to not reset to default. That bug was introduced in "Handle review comments" commit, don't remember why I did it, but I reverted to previous default governor parsing method. |
||
} | ||
|
||
function finalize_warm_boot() | ||
{ | ||
debug "Finalizing warmboot..." | ||
finalize_common | ||
sudo config warm_restart disable | ||
} | ||
|
||
function finalize_fast_reboot() | ||
{ | ||
debug "Finalizing fast-reboot..." | ||
finalize_common | ||
sonic-db-cli STATE_DB hset "FAST_RESTART_ENABLE_TABLE|system" "enable" "false" &>/dev/null | ||
sonic-db-cli CONFIG_DB DEL "WARM_RESTART|teamd" &>/dev/null | ||
} | ||
|
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.
Will this setting (or the way we are writing to a file) be effective at runtime?
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.
Yes