aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2016-01-11 11:41:53 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-15 16:36:19 -0500
commit66a5f6b63996d8aa7cbe8841b38297bf3b338194 (patch)
tree2ac1b2bc7f7eb482ca2a5b12982f45e275e3de16
parent46373a15f65fe862f31c19a484acdf551f2b442f (diff)
cpuidle: Default to ladder governor on ticking systems
The menu governor is currently the default on all systems. However the documentation claims that the ladder governor is preferred on ticking systems. So bump the rating of the ladder governor when NO_HZ is disabled, or when booting with nohz=off. This fixes the first half of kernel BZ #65531. Link: https://bugzilla.kernel.org/show_bug.cgi?id=65531 Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpuidle/governors/ladder.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
index 401c0106ed34..63bd5a403e22 100644
--- a/drivers/cpuidle/governors/ladder.c
+++ b/drivers/cpuidle/governors/ladder.c
@@ -17,6 +17,7 @@
17#include <linux/pm_qos.h> 17#include <linux/pm_qos.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/jiffies.h> 19#include <linux/jiffies.h>
20#include <linux/tick.h>
20 21
21#include <asm/io.h> 22#include <asm/io.h>
22#include <asm/uaccess.h> 23#include <asm/uaccess.h>
@@ -184,6 +185,14 @@ static struct cpuidle_governor ladder_governor = {
184 */ 185 */
185static int __init init_ladder(void) 186static int __init init_ladder(void)
186{ 187{
188 /*
189 * When NO_HZ is disabled, or when booting with nohz=off, the ladder
190 * governor is better so give it a higher rating than the menu
191 * governor.
192 */
193 if (!tick_nohz_enabled)
194 ladder_governor.rating = 25;
195
187 return cpuidle_register_governor(&ladder_governor); 196 return cpuidle_register_governor(&ladder_governor);
188} 197}
189 198