@@ -19,13 +19,13 @@ config CPU_IDLE_MULTIPLE_DRIVERS
bool
config CPU_IDLE_GOV_LADDER
- bool "Ladder governor (for periodic timer tick)"
+ tristate "Ladder governor (for periodic timer tick)"
config CPU_IDLE_GOV_MENU
- bool "Menu governor (for tickless system)"
+ tristate "Menu governor (for tickless system)"
config CPU_IDLE_GOV_TEO
- bool "Timer events oriented (TEO) governor (for tickless systems)"
+ tristate "Timer events oriented (TEO) governor (for tickless systems)"
help
This governor implements a simplified idle state selection method
focused on timer events and does not do any interactivity boosting.
@@ -34,7 +34,7 @@ config CPU_IDLE_GOV_TEO
to use. Say Y here if you are not happy with the alternatives.
config CPU_IDLE_GOV_HALTPOLL
- bool "Haltpoll governor (for virtualized systems)"
+ tristate "Haltpoll governor (for virtualized systems)"
depends on KVM_GUEST
help
This governor implements haltpoll idle state selection, to be
@@ -146,4 +146,11 @@ static int __init init_haltpoll(void)
return 0;
}
-postcore_initcall(init_haltpoll);
+static void __exit exit_haltpoll(void)
+{
+ cpuidle_unregister_governor(&haltpoll_governor);
+}
+
+module_init(init_haltpoll);
+module_exit(exit_haltpoll);
+MODULE_LICENSE("GPL v2");
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/cpuidle.h>
+#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/tick.h>
@@ -188,10 +189,17 @@ static int __init init_ladder(void)
* governor is better so give it a higher rating than the menu
* governor.
*/
- if (!tick_nohz_enabled)
+ if (!tick_nohz_is_enabled())
ladder_governor.rating = 25;
return cpuidle_register_governor(&ladder_governor);
}
-postcore_initcall(init_ladder);
+static void __exit exit_ladder(void)
+{
+ cpuidle_unregister_governor(&ladder_governor);
+}
+
+module_init(init_ladder);
+module_exit(exit_ladder);
+MODULE_LICENSE("GPL");
@@ -13,6 +13,7 @@
#include <linux/time.h>
#include <linux/ktime.h>
#include <linux/hrtimer.h>
+#include <linux/module.h>
#include <linux/tick.h>
#include <linux/sched.h>
#include <linux/sched/loadavg.h>
@@ -571,4 +572,11 @@ static int __init init_menu(void)
return cpuidle_register_governor(&menu_governor);
}
-postcore_initcall(init_menu);
+static void __exit exit_menu(void)
+{
+ cpuidle_unregister_governor(&menu_governor);
+}
+
+module_init(init_menu);
+module_exit(exit_menu);
+MODULE_LICENSE("GPL v2");
@@ -48,6 +48,7 @@
#include <linux/cpuidle.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/sched/clock.h>
#include <linux/tick.h>
@@ -491,4 +492,11 @@ static int __init teo_governor_init(void)
return cpuidle_register_governor(&teo_governor);
}
-postcore_initcall(teo_governor_init);
+static void __exit teo_governor_exit(void)
+{
+ cpuidle_unregister_governor(&teo_governor);
+}
+
+module_init(teo_governor_init);
+module_exit(teo_governor_exit);
+MODULE_LICENSE("GPL v2");
This patch converts the cpuidle governors into modules. Even if it is not the utmost importance, that will be consistent with the devfreq, the watchdog and the cpufreq governors. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/cpuidle/Kconfig | 8 ++++---- drivers/cpuidle/governors/haltpoll.c | 9 ++++++++- drivers/cpuidle/governors/ladder.c | 12 ++++++++++-- drivers/cpuidle/governors/menu.c | 10 +++++++++- drivers/cpuidle/governors/teo.c | 10 +++++++++- 5 files changed, 40 insertions(+), 9 deletions(-) -- 2.17.1