Skip to content

Commit d6f346f

Browse files
Daniel Lezcanorafaeljw
authored andcommitted
cpuidle: improve governor Kconfig options
Each governor is suitable for different kernel configurations: the menu governor suits better for a tickless system, while the ladder governor fits better for a periodic timer tick system. The Kconfig does not allow to [un]select a governor, thus both are compiled in the kernel but the init order makes the menu governor to be the last one to be registered, so becoming the default. The only way to switch back to the ladder governor is to enable the sysfs governor switch in the kernel command line. Because it seems nobody complained about this, the menu governor is used by default most of the time on the system, having both governors is not really necessary on a tickless system but there isn't a config option to disable one or another governor. Create a submenu for cpuidle and add a label for each governor, so we can see the option in the menu config and enable/disable it. The governors will be enabled depending on the CONFIG_NO_HZ option: - If CONFIG_NO_HZ is set, then the menu governor is selected and the ladder governor is optional, defaulting to 'yes' - If CONFIG_NO_HZ is not set, then the ladder governor is selected and the menu governor is optional, defaulting to 'yes' Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent d683b96 commit d6f346f

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

‎drivers/cpuidle/Kconfig‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
11

2-
config CPU_IDLE
2+
menuconfig CPU_IDLE
33
bool "CPU idle PM support"
44
default y if ACPI || PPC_PSERIES
5+
select CPU_IDLE_GOV_LADDER if (!NO_HZ && !NO_HZ_IDLE)
6+
select CPU_IDLE_GOV_MENU if (NO_HZ || NO_HZ_IDLE)
57
help
68
CPU idle is a generic framework for supporting software-controlled
79
idle processor power management. It includes modular cross-platform
810
governors that can be swapped during runtime.
911

1012
If you're using an ACPI-enabled platform, you should say Y here.
1113

14+
if CPU_IDLE
15+
1216
config CPU_IDLE_MULTIPLE_DRIVERS
1317
bool "Support multiple cpuidle drivers"
14-
depends on CPU_IDLE
1518
default n
1619
help
1720
Allows the cpuidle framework to use different drivers for each CPU.
1821
This is useful if you have a system with different CPU latencies and
1922
states. If unsure say N.
2023

2124
config CPU_IDLE_GOV_LADDER
22-
bool
23-
depends on CPU_IDLE
25+
bool "Ladder governor (for periodic timer tick)"
2426
default y
2527

2628
config CPU_IDLE_GOV_MENU
27-
bool
28-
depends on CPU_IDLE && NO_HZ
29+
bool "Menu governor (for tickless system)"
2930
default y
3031

3132
config ARCH_NEEDS_CPU_IDLE_COUPLED
3233
def_bool n
3334

34-
if CPU_IDLE
35-
3635
config CPU_IDLE_CALXEDA
3736
bool "CPU Idle Driver for Calxeda processors"
3837
depends on ARCH_HIGHBANK
3938
help
4039
Select this to enable cpuidle on Calxeda processors.
41-
4240
endif

0 commit comments

Comments
 (0)