diff mbox series

ARM: vexpress: Make schedutil governor available

Message ID 20200327095703.93178-1-linus.walleij@linaro.org (mailing list archive)
State Changes Requested
Headers show
Series ARM: vexpress: Make schedutil governor available | expand

Commit Message

Linus Walleij March 27, 2020, 9:57 a.m. UTC
When building the kernel for Versatile Express we need to
consider that some of these boards are big.LITTLE HMP
systems.

As can be seen from kernel/sched/topology.c:

"EAS can be used on a root domain if it meets all the following conditions:
 1. an Energy Model (EM) is available;
 2. the SD_ASYM_CPUCAPACITY flag is set in the sched_domain hierarchy.
 3. no SMT is detected.
 4. the EM complexity is low enough to keep scheduling overheads low;
 5. schedutil is driving the frequency of all CPUs of the rd;"

This means that at the very least, schedutil needs to be
available as a scheduling policy for EAS to work on these
systems. Make this explicit by selecting CPU_FREQ and
CPU_FREQ_GOV_SCHEDUTIL from the Versatile Express
machine.

Currently users of the TC2 board (like me) has to figure these
dependencies out themselves and it is not helpful.

It is still necessary to configure in the schedutil as default
governor manually to actually get a working b.L system, so this
just makes the right governor available to b.L systems, it does
not turn it on by default.

Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-vexpress/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

Comments

Arnd Bergmann March 27, 2020, 11:03 a.m. UTC | #1
On Fri, Mar 27, 2020 at 10:57 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> When building the kernel for Versatile Express we need to
> consider that some of these boards are big.LITTLE HMP
> systems.
>
> As can be seen from kernel/sched/topology.c:
>
> "EAS can be used on a root domain if it meets all the following conditions:
>  1. an Energy Model (EM) is available;
>  2. the SD_ASYM_CPUCAPACITY flag is set in the sched_domain hierarchy.
>  3. no SMT is detected.
>  4. the EM complexity is low enough to keep scheduling overheads low;
>  5. schedutil is driving the frequency of all CPUs of the rd;"
>
> This means that at the very least, schedutil needs to be
> available as a scheduling policy for EAS to work on these
> systems. Make this explicit by selecting CPU_FREQ and
> CPU_FREQ_GOV_SCHEDUTIL from the Versatile Express
> machine.
>
> Currently users of the TC2 board (like me) has to figure these
> dependencies out themselves and it is not helpful.
>
> It is still necessary to configure in the schedutil as default
> governor manually to actually get a working b.L system, so this
> just makes the right governor available to b.L systems, it does
> not turn it on by default.
>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Hi Linus,

I agree we should make it available by default on platforms that need it
for big.LITTLE, but I don't like the idea of selecting the governor from
a platform Kconfig file, as generally speaking it leads to more problems
when user-visible options are selected like this.

What I could imagine doing however would be to change the cpufreq
selection to use schedutil by default if CONFIG_BIG_LITTLE is set, like:

choice
        prompt "Default CPUFreq governor"
        default CPU_FREQ_DEFAULT_GOV_SCHEDUTIL if BIG_LITTLE
        default CPU_FREQ_DEFAULT_GOV_USERSPACE if ARM_SA1100_CPUFREQ
|| ARM_SA1110_CPUFREQ
        default CPU_FREQ_DEFAULT_GOV_PERFORMANCE
        help
          This option sets which CPUFreq governor shall be loaded at
          startup. If in doubt, select 'performance'.

and then changing CONFIG_BIG_LITTLE to be enabled by default on
any platform that uses that configuration. If CONFIG_BIG_LITTLE is
too overloaded already (I can't tell exactly what this is used for), a new
symbol could be added for what we want here.

      Arnd
Viresh Kumar March 27, 2020, 11:04 a.m. UTC | #2
On 27-03-20, 10:57, Linus Walleij wrote:
> When building the kernel for Versatile Express we need to
> consider that some of these boards are big.LITTLE HMP
> systems.
> 
> As can be seen from kernel/sched/topology.c:
> 
> "EAS can be used on a root domain if it meets all the following conditions:
>  1. an Energy Model (EM) is available;
>  2. the SD_ASYM_CPUCAPACITY flag is set in the sched_domain hierarchy.
>  3. no SMT is detected.
>  4. the EM complexity is low enough to keep scheduling overheads low;
>  5. schedutil is driving the frequency of all CPUs of the rd;"
> 
> This means that at the very least, schedutil needs to be
> available as a scheduling policy for EAS to work on these
> systems. Make this explicit by selecting CPU_FREQ and
> CPU_FREQ_GOV_SCHEDUTIL from the Versatile Express
> machine.
> 
> Currently users of the TC2 board (like me) has to figure these
> dependencies out themselves and it is not helpful.
> 
> It is still necessary to configure in the schedutil as default
> governor manually to actually get a working b.L system, so this
> just makes the right governor available to b.L systems, it does
> not turn it on by default.
> 
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/mach-vexpress/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
> index 726a68085c3b..0a5a67448c94 100644
> --- a/arch/arm/mach-vexpress/Kconfig
> +++ b/arch/arm/mach-vexpress/Kconfig
> @@ -8,6 +8,8 @@ menuconfig ARCH_VEXPRESS
>  	select ARM_GLOBAL_TIMER
>  	select ARM_TIMER_SP804
>  	select COMMON_CLK_VERSATILE
> +	select CPU_FREQ
> +	select CPU_FREQ_GOV_SCHEDUTIL
>  	select GPIOLIB
>  	select HAVE_ARM_SCU if SMP
>  	select HAVE_ARM_TWD if SMP

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
diff mbox series

Patch

diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 726a68085c3b..0a5a67448c94 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -8,6 +8,8 @@  menuconfig ARCH_VEXPRESS
 	select ARM_GLOBAL_TIMER
 	select ARM_TIMER_SP804
 	select COMMON_CLK_VERSATILE
+	select CPU_FREQ
+	select CPU_FREQ_GOV_SCHEDUTIL
 	select GPIOLIB
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP