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

[fast/warm-reboot] add cpufreq.default_governor=performance to BOOT_OPTIONS #88

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ function setup_reboot_variables()
local fstype=$(blkid -o value -s TYPE ${sonic_dev})
BOOT_OPTIONS="${BOOT_OPTIONS} ssd-upgrader-part=${sonic_dev},${fstype}"
fi

# Set governor to performance to speed up boot process.
# The governor is reset back to kernel default in warmboot-finalizer script.
BOOT_OPTIONS="${BOOT_OPTIONS} cpufreq.default_governor=performance"
Copy link

@nazariig nazariig Jul 18, 2024

Choose a reason for hiding this comment

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

@stepanblyschak let's add another check here:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
to make sure performance is really supported by CPU.
If not - log a relevant message and fallback to default

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 governor is not a cpu feature, governor talks to the scaling driver (cpu specific) to set a target. scaling_available_governors - This list appears to be formed from the global cpufreq_governor_list in the cpufreq driver, where all governors that are included in the kernel are registered.

This cmdline param is fairly new (>5.9) but it is very appealing to use in this case (no need to wait for user space and sysfs to be available to set the governor from user space).

When this won't work - if the next kernel is not built with performance governor as a builtin driver it won't work (governor will not change).
For that, we would have to extract the kernel config from the next image rather then checking current image scaling_available_governors. And I generally don't think we would ever remove features from kernel in next releases.

}

function check_docker_exec()
Expand Down
Loading