Skip to content

configs/raspberrypi*: stop setting powersave as the default CPU governor - #523

Open
clopez wants to merge 1 commit into
WebPlatformForEmbedded:mainfrom
clopez:main_fix_default_cpu_governor
Open

configs/raspberrypi*: stop setting powersave as the default CPU governor#523
clopez wants to merge 1 commit into
WebPlatformForEmbedded:mainfrom
clopez:main_fix_default_cpu_governor

Conversation

@clopez

Copy link
Copy Markdown
  • 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 configs: stop defaulting to the powersave governor raspberrypi/linux#5666

  • This PR already updates all RPi defconfigs, but in the future if new defconfigs are added for RPi boards then this command can be used to automate updating them:

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 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
@clopez
clopez requested a review from magomezDecember 18, 2023 17:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@clopez