-
Notifications
You must be signed in to change notification settings - Fork 5k
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
configs: stop defaulting to the powersave governor #5666
configs: stop defaulting to the powersave governor #5666
Conversation
* The default configs for the RPi shouldn't be defaulting to the powersave governor because it reduces the performance by setting the frequency to the minimum. * This is an issue even if user-space changes the governor later because it is slowing down the boot time (the kernel will boot with the minimum CPU frequency until user-space fixes it) * It is also a major issue for another projects than RaspberryPiOS that rely on this kernel and use this configs as base or default. For example: I have been bitten by this issue when using Yocto with meta-raspberrypi because their kernel config is based on this ones, so it will boot with powersave by default and there user space is not configured to change the governor. So it will remain with powersave always :( * Just don't set any default governor and let the Linux's defaults apply: which means selecting governor `schedutil` in this kernel version, but it was governor `ondemand` on older versions and on the future it can be a newer scheduler. See the logic to select the default at the file `drivers/cpufreq/Kconfig`. * Enable also the config option to ensure that the `powersave` governor is built and available if user space wants to use it. * For config bcmrpi_defconfig enable also the `schedutil` governor, which is the only config missing to enable this one. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
That's a pretty major change to push out to everyone and would break the press SHIFT to disable the performance governor behaviour (initd raspi-config) |
We default to powersave to allow boards to be booted successfully when higher clocks speeds are causing problems, e.g. with an inadequate power supply. Trying to reduce the clock with the Shift key having started up running faster may already be too late. You can always override the default with a module parameter (which sets the governor as early as the kernel's compiled-in default) - add the following to cmdline.txt:
|
This is a feature I wasn't aware of so I checked how it works by flashing RaspberryOS and doing a few tests: This is what I discovered how it works:
Now I have some comments about this feature:
Switching to I think this feature should be reworked to boot with the default governor (which nowadays is I also think the documentation should be fixed (the user is really underclocking the RPi, not disabling overclocking) And it would be nice to have some visual indication about the status of the governor, maybe some widget around the network/volume at the top. Also, please not ignore that this kernel and their configs is used by other distros that may not be aware of this settting of powersave as the default governor. See for example: agherzan/meta-raspberrypi#1231 IMHO the default governor should be policed in the RaspberryOS repository and not in this kernel repo. |
Noted. I'd be surprised if there were distros that weren't aware of our policy. We're not changing it. |
For your surprise I can tell you that not only the default Yocto builds are affected by this but also the Buildroot ones. I understand that RaspberryPiOS wants to boot the boards with the This should be a specific configuration on the RaspberryPiOS repository for the kernel cmdline ( |
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a buildroot build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either one of: `ondemand`, `schedutil` or `performance` depending on the Kernel version and the hardware. For modern Kernels (>v5.6) `schedutil` is the one preferred for ARM hardware. See Linux Kernel commit: https://git.kernel.org/linus/f259eab3ea0e7e * This patch was submitted upstream (both to the RPi kernel defconfigs and to upstream buildroot but was not accepted). See: https://lists.buildroot.org/pipermail/buildroot/2023-October/677641.html and raspberrypi/linux#5666 * In oder to update all the defconfigs this command can be used: for f in configs/raspberrypi*_defconfig; do if ! grep -q "board/raspberrypi/default-cpu-governor.fragment" "$f"; then sed -i 's,BR2_LINUX_KERNEL=y,BR2_LINUX_KERNEL=y\nBR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment",' "$f" fi done
* The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
… default CPU governor * The defconfigs from the RPi Kernel set `powersave` as the default CPU governor, which is a bad idea as that reduces performance by setting the CPU frequency to the minimum one. * In case of a Yocto build user-space is not configured by default to change the CPU governor, so `powersave` will remain the CPU governor and it will slow down everything. * I submitted a fix for those defconfigs to upstream here: raspberrypi/linux#5666 However, we shouldn't wait until that is accepted and backported to all the stable branches (if ever is). * This patch unsets the selection of `powersave` as the default CPU governor. * Then the CPU governor that will be selected as default after this patch will be the Linux's default one that is either `ondemand` or `schedutil` depending on the Kernel version. Signed-off-by: Carlos Alberto Lopez Perez <[email protected]>
The default configs for the RPi shouldn't be defaulting to the powersave governor because it reduces the performance by setting the frequency to the minimum.
This is an issue even if user-space changes the governor later because it is slowing down the boot time (the kernel will boot with the minimum CPU frequency until user-space fixes it)
It is also a major issue for another projects than RaspberryPiOS that rely on this kernel and use this configs as base or default. For example: I have been bitten by this issue when using Yocto with meta-raspberrypi because their kernel config is based on this ones, so it will boot with powersave by default and there user space is not configured to change the governor. So it will remain with powersave always :(
Just don't set any default governor and let the Linux's defaults apply: which means selecting governor
schedutil
in this kernel version, but it was governorondemand
on older versions and on the future it can be a newer scheduler. See the logic to select the default at the filedrivers/cpufreq/Kconfig
.Enable also the config option to ensure that the
powersave
governor is built and available if user space wants to use it.For config bcmrpi_defconfig enable also the
schedutil
governor, which is the only config missing to enable this one.