From 7ab5a4ea4c864657faff0d8ccf7cb30dc9060230 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Lopez Perez Date: Fri, 20 Oct 2023 02:42:37 +0100 Subject: [PATCH] linux-raspberrypi: stop setting powersave as the 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: https://github.com/raspberrypi/linux/pull/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 --- recipes-kernel/linux/files/default-cpu-governor.cfg | 7 +++++++ recipes-kernel/linux/linux-raspberrypi.inc | 1 + 2 files changed, 8 insertions(+) create mode 100644 recipes-kernel/linux/files/default-cpu-governor.cfg diff --git a/recipes-kernel/linux/files/default-cpu-governor.cfg b/recipes-kernel/linux/files/default-cpu-governor.cfg new file mode 100644 index 000000000..eafdae6ca --- /dev/null +++ b/recipes-kernel/linux/files/default-cpu-governor.cfg @@ -0,0 +1,7 @@ +# The defconfigs from the RPi Kernel set "powersave" as the default CPU governor. +# That is a bad idea as it reduces performance, so we unset that default option here. +# A fix for this was sent to upstream: https://github.com/raspberrypi/linux/pull/5666 +# However, we need to carry this option override until those defconfigs are fixed on +# *all* the kernel branches that we support. So that can be a long time depending +# on wheter the above PR gets accepted and/or backported to the stable branches. +CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=n diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index d2f3f481d..b77d1c4cf 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc @@ -15,6 +15,7 @@ SRC_URI += " \ ${@bb.utils.contains("INITRAMFS_IMAGE_BUNDLE", "1", "file://initramfs-image-bundle.cfg", "", d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "file://vc4graphics.cfg", "", d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "wm8960", "file://wm8960.cfg", "", d)} \ + file://default-cpu-governor.cfg \ " SRC_URI:append:raspberrypi4 = " \