All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor
@ 2023-10-20 14:20 Carlos Alberto Lopez Perez
  2023-10-21 21:38 ` Yann E. MORIN
  0 siblings, 1 reply; 13+ messages in thread
From: Carlos Alberto Lopez Perez @ 2023-10-20 14:20 UTC (permalink / raw)
  To: buildroot; +Cc: Martin Bark, Julien Grossholtz

* 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.

* 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 <clopez@igalia.com>
---
 board/raspberrypi/default-cpu-governor.fragment | 9 +++++++++
 configs/raspberrypi0_defconfig                  | 1 +
 configs/raspberrypi0w_defconfig                 | 1 +
 configs/raspberrypi2_defconfig                  | 1 +
 configs/raspberrypi3_64_defconfig               | 1 +
 configs/raspberrypi3_defconfig                  | 1 +
 configs/raspberrypi3_qt5we_defconfig            | 1 +
 configs/raspberrypi4_64_defconfig               | 1 +
 configs/raspberrypi4_defconfig                  | 1 +
 configs/raspberrypi_defconfig                   | 1 +
 configs/raspberrypicm4io_64_defconfig           | 1 +
 configs/raspberrypicm4io_defconfig              | 1 +
 configs/raspberrypizero2w_defconfig             | 1 +
 13 files changed, 21 insertions(+)
 create mode 100644 board/raspberrypi/default-cpu-governor.fragment

diff --git a/board/raspberrypi/default-cpu-governor.fragment b/board/raspberrypi/default-cpu-governor.fragment
new file mode 100644
index 0000000000..e2e201d71d
--- /dev/null
+++ b/board/raspberrypi/default-cpu-governor.fragment
@@ -0,0 +1,9 @@
+# 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.
+# The option to build the powersave governor (but not as the default) is also enabled.
+# 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
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
diff --git a/configs/raspberrypi0_defconfig b/configs/raspberrypi0_defconfig
index 4506e94bce..a5a019822d 100644
--- a/configs/raspberrypi0_defconfig
+++ b/configs/raspberrypi0_defconfig
@@ -8,6 +8,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
diff --git a/configs/raspberrypi0w_defconfig b/configs/raspberrypi0w_defconfig
index 7a35794c2d..420cf53f7c 100644
--- a/configs/raspberrypi0w_defconfig
+++ b/configs/raspberrypi0w_defconfig
@@ -8,6 +8,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
diff --git a/configs/raspberrypi2_defconfig b/configs/raspberrypi2_defconfig
index 9b484c5588..84c7a85393 100644
--- a/configs/raspberrypi2_defconfig
+++ b/configs/raspberrypi2_defconfig
@@ -11,6 +11,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
diff --git a/configs/raspberrypi3_64_defconfig b/configs/raspberrypi3_64_defconfig
index 4d838ae0e8..b67cd5ae90 100644
--- a/configs/raspberrypi3_64_defconfig
+++ b/configs/raspberrypi3_64_defconfig
@@ -10,6 +10,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3"
diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig
index 0a59ab42a9..81995bb67e 100644
--- a/configs/raspberrypi3_defconfig
+++ b/configs/raspberrypi3_defconfig
@@ -10,6 +10,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
diff --git a/configs/raspberrypi3_qt5we_defconfig b/configs/raspberrypi3_qt5we_defconfig
index 40d0c0f888..4040d03066 100644
--- a/configs/raspberrypi3_qt5we_defconfig
+++ b/configs/raspberrypi3_qt5we_defconfig
@@ -11,6 +11,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
diff --git a/configs/raspberrypi4_64_defconfig b/configs/raspberrypi4_64_defconfig
index 5942f7c4e1..fb2a916a4c 100644
--- a/configs/raspberrypi4_64_defconfig
+++ b/configs/raspberrypi4_64_defconfig
@@ -10,6 +10,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
diff --git a/configs/raspberrypi4_defconfig b/configs/raspberrypi4_defconfig
index 4e5580c140..2a2fc2aa21 100644
--- a/configs/raspberrypi4_defconfig
+++ b/configs/raspberrypi4_defconfig
@@ -10,6 +10,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
diff --git a/configs/raspberrypi_defconfig b/configs/raspberrypi_defconfig
index cca53f9b37..55deb343b2 100644
--- a/configs/raspberrypi_defconfig
+++ b/configs/raspberrypi_defconfig
@@ -10,6 +10,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
diff --git a/configs/raspberrypicm4io_64_defconfig b/configs/raspberrypicm4io_64_defconfig
index 29cb0472d7..b4abc9126b 100644
--- a/configs/raspberrypicm4io_64_defconfig
+++ b/configs/raspberrypicm4io_64_defconfig
@@ -10,6 +10,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
diff --git a/configs/raspberrypicm4io_defconfig b/configs/raspberrypicm4io_defconfig
index 017aecc0dd..106ca50609 100644
--- a/configs/raspberrypicm4io_defconfig
+++ b/configs/raspberrypicm4io_defconfig
@@ -10,6 +10,7 @@ BR2_SYSTEM_DHCP="eth0"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
diff --git a/configs/raspberrypizero2w_defconfig b/configs/raspberrypizero2w_defconfig
index 2ea503ca24..17e386d4f1 100644
--- a/configs/raspberrypizero2w_defconfig
+++ b/configs/raspberrypizero2w_defconfig
@@ -8,6 +8,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
 
 BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/default-cpu-governor.fragment"
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-10-24 20:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-20 14:20 [Buildroot] [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor Carlos Alberto Lopez Perez
2023-10-21 21:38 ` Yann E. MORIN
2023-10-23 12:40   ` Marcus Hoffmann via buildroot
2023-10-23 16:25     ` Yann E. MORIN
2023-10-23 20:23       ` Carlos Alberto Lopez Perez
2023-10-24 14:01         ` [Buildroot] [External] - " Vincent Fazio
2023-10-24 14:28           ` Carlos Alberto Lopez Perez
2023-10-24 14:52             ` Vincent Fazio
2023-10-24 15:00               ` Carlos Alberto Lopez Perez
2023-10-24 15:17                 ` Vincent Fazio
2023-10-24 15:28                   ` Carlos Alberto Lopez Perez
2023-10-24 19:07                     ` Yann E. MORIN
2023-10-24 20:53                       ` Carlos Alberto Lopez Perez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.