cpuquiet: Enable cpuquiet by default
authorSai Charan Gurrappadi <sgurrappadi@nvidia.com>
Fri, 22 Jun 2012 23:18:02 +0000 (16:18 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 18 May 2015 08:07:07 +0000 (16:07 +0800)
Enable cpuquiet by default if autohotplug is enabled. Cpuquiet will now
replace autohotplug as the hotplugging infrastructure. The down_delay in
the balanced governor has also been increased to 2s from 500ms to match
a similar patch for autohotplug.

Change-Id: I36747af67c55547b3dee95f7d435f9ebc075d393
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/123851
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
drivers/cpuquiet/Kconfig
drivers/cpuquiet/governors/balanced.c
drivers/cpuquiet/governors/userspace.c

index 844cd34a69b3935138007583c5b9563de9594308..61e707312ad71a01334d34058046df0eb032f801 100644 (file)
@@ -2,10 +2,37 @@ menu "CPUQUIET Framework"
 
 config CPUQUIET_FRAMEWORK
        bool "Cpuquiet framework"
-       default n
        help
          Cpuquiet implements pluggable policies for forcing cpu cores into a
          quiescent state. Appropriate policies will save power without hurting
          performance.
 
+
+if CPUQUIET_FRAMEWORK
+
+choice
+       prompt "Default CPUQuiet governor"
+       help
+         This option sets which CPUQuiet governor shall be loaded at
+         startup. If in doubt, select 'userspace'
+
+config CPUQUIET_DEFAULT_GOV_USERSPACE
+       bool "userspace"
+       select CPUQUIET_GOVERNOR_USERSPACE
+       help
+         Use the CPUQuiet governor 'userspace' as default. This disables
+         any automatic hotplugging of cpus and allows manual control
+         over the number of cpus online in the system
+
+config CPUQUIET_DEFAULT_GOV_BALANCED
+       bool "balanced"
+       select CPUQUIET_GOVERNOR_BALANCED
+       depends on CPU_FREQ
+       help
+         Use the CPUQuiet governor 'balanced' as default. This dynamically
+         scales the number of cpus online in the system based on the cpu
+         load
+endchoice
+
+endif
 endmenu
index 61dd2cb1009aed350c6843f95536b7c0e7c8b29b..d95be18596ab27e9fa9efb622fe5337fe38a7b9f 100644 (file)
@@ -416,7 +416,7 @@ static int balanced_start(void)
        INIT_DELAYED_WORK(&balanced_work, balanced_work_func);
 
        up_delay = msecs_to_jiffies(100);
-       down_delay = msecs_to_jiffies(500);
+       down_delay = msecs_to_jiffies(2000);
 
        table = cpufreq_frequency_get_table(0);
        for (count = 0; table[count].frequency != CPUFREQ_TABLE_END; count++);
@@ -456,6 +456,10 @@ static void __exit exit_balanced(void)
 }
 
 MODULE_LICENSE("GPL");
+#ifdef CONFIG_CPUQUIET_DEFAULT_GOV_BALANCED
+fs_initcall(init_balanced);
+#else
 module_init(init_balanced);
+#endif
 module_exit(exit_balanced);
 
index 470056c5e32a4736cef8c076508c07f8a88b6c0e..664594d68d8c25a87097248fefab9e3133db63cc 100644 (file)
@@ -52,5 +52,9 @@ static void __exit exit_usermode(void)
 }
 
 MODULE_LICENSE("GPL");
+#ifdef CONFIG_CPUQUIET_DEFAULT_GOV_USERSPACE
+fs_initcall(init_usermode);
+#else
 module_init(init_usermode);
+#endif
 module_exit(exit_usermode);