Skip to contentSkip to conversation

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

PATCH In review Carlos Alberto Lopez Perez 4 participants 13 messages Oct 20, 2023 – Oct 24, 2023 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs/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 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.

---
 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
board/raspberrypi/default-cpu-governor.fragment new file +9 -0
new file mode 100644
index 0000000000..e2e201d71d
@@ -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
configs/raspberrypi0_defconfig +1 -0
index 4506e94bce..a5a019822d 100644
@@ -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"
configs/raspberrypi0w_defconfig +1 -0
index 7a35794c2d..420cf53f7c 100644
@@ -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"
configs/raspberrypi2_defconfig +1 -0
index 9b484c5588..84c7a85393 100644
@@ -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"
configs/raspberrypi3_64_defconfig +1 -0
index 4d838ae0e8..b67cd5ae90 100644
@@ -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"
configs/raspberrypi3_defconfig +1 -0
index 0a59ab42a9..81995bb67e 100644
@@ -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"
configs/raspberrypi3_qt5we_defconfig +1 -0
index 40d0c0f888..4040d03066 100644
@@ -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"
configs/raspberrypi4_64_defconfig +1 -0
index 5942f7c4e1..fb2a916a4c 100644
@@ -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"
configs/raspberrypi4_defconfig +1 -0
index 4e5580c140..2a2fc2aa21 100644
@@ -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"
configs/raspberrypi_defconfig +1 -0
index cca53f9b37..55deb343b2 100644
@@ -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"
configs/raspberrypicm4io_64_defconfig +1 -0
index 29cb0472d7..b4abc9126b 100644
@@ -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"
configs/raspberrypicm4io_defconfig +1 -0
index 017aecc0dd..106ca50609 100644
@@ -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"
configs/raspberrypizero2w_defconfig +1 -0
index 2ea503ca24..17e386d4f1 100644
@@ -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"
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Carlos, All,

On 2023-10-20 15:20 +0100, Carlos Alberto Lopez Perez spake thusly:

Quoted 4 lines

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

Quoted 8 lines

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

Unfortunately, the rpi folks have rejected this change:

https://github.com/raspberrypi/linux/pull/5666#issuecomment-1772531097

We're not changing it.

So, as much as I understand the situation, we're are not going to go counter the upstream decision.

Besides, it is not proper kconfig syntax, see below.

[--SNIP--]

Quoted 6 lines
board/raspberrypi/default-cpu-governor.fragment new file +0 -0
new file mode 100644
index 0000000000..e2e201d71d

board/raspberrypi/default-cpu-governor.fragment line 8

Quoted 8 lines
board/raspberrypi/default-cpu-governor.fragment new file +8 -0
@@ -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

In kconfig, a symbol is never set to 'n'; rather it is not set as a comment, e.g."

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Yann, all,

Quoted 16 lines · Yann E. MORIN

Carlos, All,

On 2023-10-20 15:20 +0100, Carlos Alberto Lopez Perez spake thusly:

Quoted 4 lines

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

Quoted 8 lines

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

Quoted 8 lines

Unfortunately, the rpi folks have rejected this change:

https://github.com/raspberrypi/linux/pull/5666#issuecomment-1772531097

We're not changing it.

So, as much as I understand the situation, we're are not going to go counter the upstream decision.

The upstream situation is that the governor is changed by default to 'ondemand' during boot though, which I don't think the rpi buildroot defconfigs do?

So while rpi-OS will be running with 'powersave' governor during early boot (which they have somewhat good reasons for, that I'm not sure apply to the buildroot project, but well, I'm not going to argue that we should necessarily deviate here) for buildroot as it currently stands we'll just be running with 'powersave' governor all the way through, which is most likely not what anyone wants.

Quoted 22 lines

Besides, it is not proper kconfig syntax, see below.

[--SNIP--]

Quoted 6 lines
board/raspberrypi/default-cpu-governor.fragment new file +0 -0
new file mode 100644
index 0000000000..e2e201d71d

board/raspberrypi/default-cpu-governor.fragment line 8

Quoted 8 lines
board/raspberrypi/default-cpu-governor.fragment new file +8 -0
@@ -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

In kconfig, a symbol is never set to 'n'; rather it is not set as a comment, e.g."

Quoted 5 lines

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

Regards,
Yann E. MORIN.

Best,
Marcus
________________________________

othermo GmbH | Sitz der Gesellschaft: Alzenau | Amtsgericht Aschaffenburg: HRB 14783 | USt-IdNr.: DE319977978 | Geschäftsführung: Dr. Dennis Metz.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Marcus, All,

On 2023-10-23 14:40 +0200, Marcus Hoffmann via buildroot spake thusly:

Quoted 16 lines · Yann E. MORIN
Quoted 15 lines

Carlos, All,

On 2023-10-20 15:20 +0100, Carlos Alberto Lopez Perez spake thusly:

Quoted 12 lines

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

Quoted 6 lines
Quoted 3 lines

Unfortunately, the rpi folks have rejected this change:
https://github.com/raspberrypi/linux/pull/5666#issuecomment-1772531097
We're not changing it.

The upstream situation is that the governor is changed by default to 'ondemand' during boot though, which I don't think the rpi buildroot defconfigs do?

The defconfigs are basic configurations that just demonstrate the basic behaviour of a board, with minimal to no tweaking to deviate from upstreams.

Users are suposed to take those defconfigs, and adapt to their needs. If they want to change the governor, then they can provide a startup script that enables the required governor. Maybe we could cary such a script in an overlay in board/raspberrypi/, though. Just maybe...

Regards,
Yann E. MORIN.

Quoted 44 lines

So while rpi-OS will be running with 'powersave' governor during early boot (which they have somewhat good reasons for, that I'm not sure apply to the buildroot project, but well, I'm not going to argue that we should necessarily deviate here) for buildroot as it currently stands we'll just be running with 'powersave' governor all the way through, which is most likely not what anyone wants.

Quoted 22 lines

Besides, it is not proper kconfig syntax, see below.

[--SNIP--]

Quoted 6 lines
board/raspberrypi/default-cpu-governor.fragment new file +0 -0
new file mode 100644
index 0000000000..e2e201d71d

board/raspberrypi/default-cpu-governor.fragment line 8

Quoted 8 lines
board/raspberrypi/default-cpu-governor.fragment new file +8 -0
@@ -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

In kconfig, a symbol is never set to 'n'; rather it is not set as a comment, e.g."

Quoted 5 lines

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

Regards,
Yann E. MORIN.

Best,
Marcus
________________________________

othermo GmbH | Sitz der Gesellschaft: Alzenau | Amtsgericht Aschaffenburg: HRB 14783 | USt-IdNr.: DE319977978 | Geschäftsführung: Dr. Dennis Metz.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
Quoted 26 lines · Yann E. MORIN

Marcus, All,

On 2023-10-23 14:40 +0200, Marcus Hoffmann via buildroot spake thusly:

Quoted 16 lines · Yann E. MORIN
Quoted 15 lines

Carlos, All,

On 2023-10-20 15:20 +0100, Carlos Alberto Lopez Perez spake thusly:

Quoted 12 lines

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

Quoted 6 lines
Quoted 3 lines

Unfortunately, the rpi folks have rejected this change:
https://github.com/raspberrypi/linux/pull/5666#issuecomment-1772531097
We're not changing it.

The upstream situation is that the governor is changed by default to 'ondemand' during boot though, which I don't think the rpi buildroot defconfigs do?

Quoted 9 lines

The defconfigs are basic configurations that just demonstrate the basic behaviour of a board, with minimal to no tweaking to deviate from upstreams.

Users are suposed to take those defconfigs, and adapt to their needs. If they want to change the governor, then they can provide a startup script that enables the required governor. Maybe we could cary such a script in an overlay in board/raspberrypi/, though. Just maybe...

Who is upstream? mainline Linux or the Linux RPi-OS fork?

Because the default governor for Linux is schedutil and is what any user would expect to get on their build (IMHO).

The RPi guys are the ones changing the default CPU governor of Linux for some obscure feature of RPi-OS.

I have argued with them that the place to do this change is not on the Linux Kernel defconfigs but on their repository for RPi-OS because other projects (like buildroot) depend on them. But they are not willing to change this.

So I think Buildroot should undo that change in order to keep the Linux default CPU governor to the Linux's default one (schedutil)

It is actually a bit surprising to me that we have to argue about this at all. I thought this change would be uncontroversial. I don't know why anyone would want to have the powersave governor by default or think that is a good idea.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

All,

Quoted 43 lines

-----Original Message-----
From: buildroot <[email protected]> On Behalf Of Carlos Alberto Lopez Perez
Sent: Monday, October 23, 2023 3:24 PM
To: Yann E. MORIN <[email protected]>; Marcus Hoffmann <[email protected]>
Cc: Martin Bark <[email protected]>; Julien Grossholtz <[email protected]>; [email protected]
Subject: [External] - Re: [Buildroot] [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

Quoted 21 lines · Yann E. MORIN

Marcus, All,

On 2023-10-23 14:40 +0200, Marcus Hoffmann via buildroot spake thusly:

Quoted 18 lines · Yann E. MORIN
Quoted 17 lines

Carlos, All,

On 2023-10-20 15:20 +0100, Carlos Alberto Lopez Perez spake thusly:

Quoted 4 lines

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

Quoted 8 lines

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

Unfortunately, the rpi folks have rejected this change:
https://github.com/raspberrypi/linux/pull/5666#issuecomment-

1772531097

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

We're not changing it.

The upstream situation is that the governor is changed by default to 'ondemand' during boot though, which I don't think the rpi buildroot defconfigs do?

The defconfigs are basic configurations that just demonstrate the basic behaviour of a board, with minimal to no tweaking to deviate from upstreams.

Quoted 7 lines
Quoted 5 lines

Users are suposed to take those defconfigs, and adapt to their needs. If they want to change the governor, then they can provide a startup script that enables the required governor. Maybe we could cary such a script in an overlay in board/raspberrypi/, though. Just maybe...

Who is upstream? mainline Linux or the Linux RPi-OS fork?

"Upstream" for the in-tree RPi configs is the RPi Linux kernel. The maintainers of that fork continue to address issues for their suite of products whereas full support has not, to my knowledge, been completely upstreamed to linux-stable.

Quoted 7 lines

Because the default governor for Linux is schedutil and is what any user would expect to get on their build (IMHO).

The RPi guys are the ones changing the default CPU governor of Linux for some obscure feature of RPi-OS.

Per Phil:
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.

I have personally had issues booting CM3+ boards with ondemand governors with ethernet plugged in when the CPUs don't have heat sinks on them.

Quoted 7 lines

I have argued with them that the place to do this change is not on the Linux Kernel defconfigs but on their repository for RPi-OS because other projects (like buildroot) depend on them. But they are not willing to change this.

So I think Buildroot should undo that change in order to keep the Linux default CPU governor to the Linux's default one (schedutil)

Can't this be done by one of the following:
1) provide your own kernel defconfig file
2) fork the RPi kernel with your own changes and use that ref
3) add a kconfig fragment to switch the default governor
4) adjust the kernel commandline in config.txt with your chosen governor
5) use a startup script to change governors post boot (obviously doesn't fix the "must boot fast" issue)

Quoted 11 lines

It is actually a bit surprising to me that we have to argue about this at all. I thought this change would be uncontroversial. I don't know why anyone would want to have the powersave governor by default or think that is a good idea.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

Quoted 5 lines · Vincent Fazio

Per Phil:
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.

I have personally had issues booting CM3+ boards with ondemand governors with ethernet plugged in when the CPUs don't have heat sinks on them.

I don't know why the rest of users should inherit a default that is meant to address a corner case (CM3 boards without heat sinks) and that slows down everything for them.

What is worse, they likely won't notice they are running with the lowest possible frequency.

On the other hand, if we default to the Linux default scheduler (schedutil) then the (minority of) users with overheat problems will notice something doesn't work as expected (board stops working or the kernel-log prints errors) so they can change the governor or put a hetsink if they suspect overheat issues.

Quoted 7 lines
Quoted 7 lines

I have argued with them that the place to do this change is not on the Linux Kernel defconfigs but on their repository for RPi-OS because other projects (like buildroot) depend on them. But they are not willing to change this.

So I think Buildroot should undo that change in order to keep the Linux default CPU governor to the Linux's default one (schedutil)

Quoted 7 lines

Can't this be done by one of the following:
1) provide your own kernel defconfig file
2) fork the RPi kernel with your own changes and use that ref
3) add a kconfig fragment to switch the default governor
4) adjust the kernel commandline in config.txt with your chosen governor
5) use a startup script to change governors post boot (obviously doesn't fix the "must boot fast" issue)

Yes, I know how to fix this on my build.

But I'm trying to do a service to the community and change the default to a more sane option. I'm actually not changing the default, just resetting it to the default Linux mainline option (undoing the change that the RPi-OS guys do for their product)

The RPi-OS guys do option 5) for this, so its ok for them to default to powersave. But Buildroot doesn't have anything like that and I'm not going to work on it.

The reality nowdays is that all buildroot RPi users are actually running with powersave governor by default and I bet 90% of them don't know it.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#7 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

All,

Quoted 17 lines

-----Original Message-----
From: Carlos Alberto Lopez Perez <[email protected]>
Sent: Tuesday, October 24, 2023 9:29 AM
To: Vincent Fazio <[email protected]>; Yann E. MORIN <[email protected]>; Marcus Hoffmann <[email protected]>
Cc: Martin Bark <[email protected]>; Julien Grossholtz <[email protected]>; [email protected]
Subject: Re: [External] - Re: [Buildroot] [PATCH 1/1] configs/raspberrypi*:
stop setting powersave as the default CPU governor

Quoted 2 lines · Vincent Fazio

Per Phil:
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.

Quoted 1 line
Quoted 9 lines
Quoted 1 line

I have personally had issues booting CM3+ boards with ondemand

governors with ethernet plugged in when the CPUs don't have heat sinks on them.

Quoted 1 line

I don't know why the rest of users should inherit a default that is meant to address a corner case (CM3 boards without heat sinks) and that slows down everything for them.

RPis can be deployed in numerous ways, such as being seated in custom carrier boards, so I do agree with upstream when it comes to "playing it safe" and if your situation/design
proves out and isn't flaky, then you can opt-in to a more "aggressive" governor.

I think the problem we can all agree on here, however, and it's a point you made in your upstream PR, is that it isn't advertised or clear that by default all RPis will be running on the powersave governor so people don't even know they may want to change it.

Quoted 27 lines

What is worse, they likely won't notice they are running with the lowest possible frequency.

On the other hand, if we default to the Linux default scheduler (schedutil) then the (minority of) users with overheat problems will notice something doesn't work as expected (board stops working or the kernel-log prints errors) so they can change the governor or put a hetsink if they suspect overheat issues.

Quoted 3 lines
Quoted 3 lines

I have argued with them that the place to do this change is not on the Linux Kernel defconfigs but on their repository for RPi-OS because other projects (like buildroot) depend on them. But they are not

willing to change this.

Quoted 4 lines
Quoted 4 lines

So I think Buildroot should undo that change in order to keep the Linux default CPU governor to the Linux's default one (schedutil)

Quoted 9 lines

Can't this be done by one of the following:
1) provide your own kernel defconfig file
2) fork the RPi kernel with your own changes and use that ref
3) add a kconfig fragment to switch the default governor
4) adjust the kernel commandline in config.txt with your chosen governor
5) use a startup script to change governors post boot (obviously doesn't fix the "must boot fast" issue)

Quoted 7 lines

Yes, I know how to fix this on my build.

But I'm trying to do a service to the community and change the default to a more sane option. I'm actually not changing the default, just resetting it to the default Linux mainline option (undoing the change that the RPi-OS guys do for their product)

It may make sense to update board/raspberrypi/readme.txt to call out that the default governor for the upstream RPi kernel is powersave and that if users want to change it how they may go about doing so.

I, personally, see value in the cpu governor kconfig fragment to "revert" to the default linux-stable governor if consumers want to opt-in so everyone doesn't have to reinvent that wheel.

I obviously defer to the BR maintainers about whether the rpi defconfigs should use it by default.

Quoted 6 lines

The RPi-OS guys do option 5) for this, so its ok for them to default to powersave. But Buildroot doesn't have anything like that and I'm not going to work on it.

The reality nowdays is that all buildroot RPi users are actually running with powersave governor by default and I bet 90% of them don't know it.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#8 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

Quoted 24 lines · Vincent Fazio

All,

Quoted 22 lines

-----Original Message-----
From: Carlos Alberto Lopez Perez <[email protected]>
Sent: Tuesday, October 24, 2023 9:29 AM
To: Vincent Fazio <[email protected]>; Yann E. MORIN <[email protected]>; Marcus Hoffmann <[email protected]>
Cc: Martin Bark <[email protected]>; Julien Grossholtz <[email protected]>; [email protected]
Subject: Re: [External] - Re: [Buildroot] [PATCH 1/1] configs/raspberrypi*:
stop setting powersave as the default CPU governor

Quoted 2 lines · Vincent Fazio

Per Phil:
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.

Quoted 2 lines

I have personally had issues booting CM3+ boards with ondemand

governors with ethernet plugged in when the CPUs don't have heat sinks on them.

Quoted 1 line
Quoted 9 lines
Quoted 4 lines

I don't know why the rest of users should inherit a default that is meant to address a corner case (CM3 boards without heat sinks) and that slows down everything for them.

RPis can be deployed in numerous ways, such as being seated in custom carrier boards, so I do agree with upstream when it comes to "playing it safe" and if your situation/design
proves out and isn't flaky, then you can opt-in to a more "aggressive" governor.

That is not true. Upstream RPi-OS defaults to the ondemand governor. The kernel boots with powersave but there is an init scripy that swichts it to ondemand as soon as the board boots unless the user press the shift key.

So what is opt-in is to use powersave (the user has to press shift), by default they run with ondemand governor (ondemand is equivalent to shedutil, just older)

Quoted 39 lines

I think the problem we can all agree on here, however, and it's a point you made in your upstream PR, is that it isn't advertised or clear that by default all RPis will be running on the powersave governor so people don't even know they may want to change it.

Quoted 27 lines

What is worse, they likely won't notice they are running with the lowest possible frequency.

On the other hand, if we default to the Linux default scheduler (schedutil) then the (minority of) users with overheat problems will notice something doesn't work as expected (board stops working or the kernel-log prints errors) so they can change the governor or put a hetsink if they suspect overheat issues.

Quoted 3 lines
Quoted 3 lines

I have argued with them that the place to do this change is not on the Linux Kernel defconfigs but on their repository for RPi-OS because other projects (like buildroot) depend on them. But they are not

willing to change this.

Quoted 4 lines
Quoted 4 lines

So I think Buildroot should undo that change in order to keep the Linux default CPU governor to the Linux's default one (schedutil)

Quoted 9 lines

Can't this be done by one of the following:
1) provide your own kernel defconfig file
2) fork the RPi kernel with your own changes and use that ref
3) add a kconfig fragment to switch the default governor
4) adjust the kernel commandline in config.txt with your chosen governor
5) use a startup script to change governors post boot (obviously doesn't fix the "must boot fast" issue)

Quoted 7 lines

Yes, I know how to fix this on my build.

But I'm trying to do a service to the community and change the default to a more sane option. I'm actually not changing the default, just resetting it to the default Linux mainline option (undoing the change that the RPi-OS guys do for their product)

Quoted 9 lines

It may make sense to update board/raspberrypi/readme.txt to call out that the default governor for the upstream RPi kernel is powersave and that if users want to change it how they may go about doing so.

I, personally, see value in the cpu governor kconfig fragment to "revert" to the default linux-stable governor if consumers want to opt-in so everyone doesn't have to reinvent that wheel.

I obviously defer to the BR maintainers about whether the rpi defconfigs should use it by default.

I think it should be done the other way. Default to the Linux one (schedutil/ondemand) and maybe document on the readme that if anyone wants to use the powersave governor document how to do it.

Please note that RPi-OS also defaults to the ondemand governor by default. Using powersave is optional (user has to press shift key while booting the board).

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

Quoted 20 lines

-----Original Message-----
From: Carlos Alberto Lopez Perez <[email protected]>
Sent: Tuesday, October 24, 2023 10:00 AM
To: Vincent Fazio <[email protected]>; Yann E. MORIN <[email protected]>; Marcus Hoffmann <[email protected]>
Cc: Martin Bark <[email protected]>; Julien Grossholtz <[email protected]>; [email protected]
Subject: Re: [External] - Re: [Buildroot] [PATCH 1/1] configs/raspberrypi*:
stop setting powersave as the default CPU governor

Quoted 6 lines · Vincent Fazio

All,

RPis can be deployed in numerous ways, such as being seated in custom carrier boards, so I do agree with upstream when it comes to "playing it safe" and if your situation/design proves out and isn't flaky, then you can

Quoted 7 lines

opt-in to a more "aggressive" governor.

Quoted 1 line

That is not true. Upstream RPi-OS defaults to the ondemand governor. The kernel boots with powersave but there is an init scripy that swichts it to ondemand as soon as the board boots unless the user press the shift key.

Sorry, I wasn't very clear here. When I said upstream, I meant "upstream RPi kernel", which default to powersave. RPi-OS does have a mechanism to switch governors post boot.

FWIW, we use vanilla arm64 Debian Bookworm on our RPis and had to tackle this problem too, so I do understand where you're coming from.

Again, I think the biggest issue is just informing users and letting them choose the right solution for their deployment.

Quoted 23 lines

So what is opt-in is to use powersave (the user has to press shift), by default they run with ondemand governor (ondemand is equivalent to shedutil, just older)

Quoted 3 lines

I think the problem we can all agree on here, however, and it's a point you made in your upstream PR, is that it isn't advertised or clear that by default all RPis will be running on the powersave governor so

people don't even know they may want to change it.

Quoted 8 lines

It may make sense to update board/raspberrypi/readme.txt to call out that the default governor for the upstream RPi kernel is powersave and that if users want to change it how they may go about doing so.

I, personally, see value in the cpu governor kconfig fragment to "revert" to the default linux-stable governor if consumers want to opt-in so

everyone doesn't have to reinvent that wheel.

Quoted 2 lines

I obviously defer to the BR maintainers about whether the rpi defconfigs

should use it by default.

Quoted 1 line
Quoted 7 lines

I think it should be done the other way. Default to the Linux one (schedutil/ondemand) and maybe document on the readme that if anyone wants to use the powersave governor document how to do it.

Please note that RPi-OS also defaults to the ondemand governor by default. Using powersave is optional (user has to press shift key while booting the board).

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#10 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

Quoted 11 lines · Vincent Fazio
Quoted 4 lines

That is not true. Upstream RPi-OS defaults to the ondemand governor. The kernel boots with powersave but there is an init scripy that swichts it to ondemand as soon as the board boots unless the user press the shift key.

Sorry, I wasn't very clear here. When I said upstream, I meant "upstream RPi kernel", which default to powersave. RPi-OS does have a mechanism to switch governors post boot.

FWIW, we use vanilla arm64 Debian Bookworm on our RPis and had to tackle this problem too, so I do understand where you're coming from.

Again, I think the biggest issue is just informing users and letting them choose the right solution for their deployment.

I'm all in for informing users and letting them to choose a default.

On the other hand a default selection has to be made for those users that don't care or don't have time to read the documentation.

And I repeat: RPi-OS defaults to ondemand governor because they change the governor on boot with an init script.

The governor powersave is only used for the first seconds of the boot process and is opt-in the rest of the time (the user has to press shit key meanwhile booting to keep it).

So the current status quo is this one:

1) RPi default CPU governor of mainline Linux kernel: schedutil or
ondemand (depends on the kernel version)
2) RPi default CPU governor of RPi-OS: ondemand (powersave opt-in if
user press shit)
3) RPi default CPU governor of buildroot: powersave

Why buildroot would want to have a default of powersave that not even matches what RPi-OS does?
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#11 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

Carlos, All,

Thanks for all the back-n-forth on the subject, I think interested parties expresed their view, and here's my last take on the topic, see below...

On 2023-10-24 17:28 +0200, Carlos Alberto Lopez Perez spake thusly:

Quoted 6 lines · Vincent Fazio
Quoted 5 lines
Quoted 3 lines

That is not true. Upstream RPi-OS defaults to the ondemand governor. The kernel boots with powersave but there is an init scripy that swichts it to ondemand as soon as the board boots unless the user press the shift key.

Sorry, I wasn't very clear here. When I said upstream, I meant "upstream RPi kernel", which default to powersave.

Exactly: the people responsible for maintaing the kernel for the raspberry pi are the upstream for that kernel. They have decided upon a default behaviour they want the kernel to have, so this is what we're following too: it's rpi-upstream's decision to default to powersave.

Quoted 2 lines
Quoted 2 lines

RPi-OS does
have a mechanism to switch governors post boot.

RPi-OS is a debian-based distribution using the rpi kernel; they are a downstream of the rpi kernel, like we are. RPi-OS have done their integration to switch to using a different behaviour, using a startup script (or a systemd unit, that's equivalent); they haven't decided to change the kernel configuration (AFAICS from this thread).

And Buildroot is not RPi-OS.

Besides, some people have started to rely on the fact that a build with Buildroot will use the powersave governor: Vincent explained a use-case for which such a default makes sense; on my side I also use (have used) rpis with powersave because of thermal stability.

Quoted 9 lines
Quoted 2 lines

Again, I think the biggest issue is just informing users and letting them choose the right solution for their deployment.

I'm all in for informing users and letting them to choose a default.

On the other hand a default selection has to be made for those users that don't care or don't have time to read the documentation.

And I repeat: RPi-OS defaults to ondemand governor because they change the governor on boot with an init script.

Exactly: they have an init script; they do not change the kernel configuration.

Quoted 6 lines

The governor powersave is only used for the first seconds of the boot process and is opt-in the rest of the time (the user has to press shit key meanwhile booting to keep it).

So the current status quo is this one:

Quoted 8 lines

1) RPi default CPU governor of mainline Linux kernel: schedutil or
ondemand (depends on the kernel version)
2) RPi default CPU governor of RPi-OS: ondemand (powersave opt-in if
user press shit)
3) RPi default CPU governor of buildroot: powersave

Why buildroot would want to have a default of powersave that not even matches what RPi-OS does?

Because we are *not* RPi-OS. We are not matching against RPi-OS; we are using rpi-kernel upstream decision.

In another email [0], you wrote;

Quoted 2 lines

The reality nowdays is that all buildroot RPi users are actually running with powersave governor by default and I bet 90% of them don't know it.

If they did not notice, then doesn't that mean that the rpi is behaving good enough for them, and that they in fact do not need the extra speed?

And again, here's a repeat from a previous comment of mine:

The defconfigs are basic configurations that just demonstrate the basic behaviour of a board, with minimal to no tweaking to deviate from upstreams. Users are suposed to take those defconfigs, and adapt to their needs. If they want to change the governor, then they can provide a startup script that enables the required governor.

[0] https://lore.kernel.org/buildroot/[email protected]/

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#12 lore raw

Re: [Buildroot] [External] - Re: [PATCH 1/1] configs/raspberrypi*: stop setting powersave as the default CPU governor

Quoted 2 lines · Yann E. MORIN

Because we are *not* RPi-OS. We are not matching against RPi-OS; we are using rpi-kernel upstream decision.

rpi-kernel upstream decision can't be considered alone. They just do this because they have an init script that later changes the governor to ondemand on RPi-OS.

They are not defining those defconfings thinking on other downstreams than RPi-OS.

I think they are committing a mistake by doing that: the kernel defconfig is not the right place to set such behaviour. They should be setting powersave as default from the debian/rules of the kernel package instead.

And I think you are committing another mistake by taking their defconfigs as something that should be the default or is thought for other downstreams than RPi-OS.

It makes *zero* sense to have powersave as default without that init script that later changes it.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot