Skip to contentSkip to conversation

consolidate cpufreq cmdline handling

PATCH New Jan Beulich 1 participant 1 message Feb 3, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 consolidate cpufreq cmdline handling

... by moving as much of the option processing into cpufreq code as is possible, by folding the cpufreq_governor option into the cpufreq one (the governor name, if any, must be specified as the first thing after the separator following "cpufreq=xen"), and by allowing each governor to have an option processing routine.

xen/common/domain.c +0 -14
@@ -41,7 +41,6 @@ boolean_param("dom0_vcpus_pin", opt_dom0
 
 /* set xen as default cpufreq */
 enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
-struct cpufreq_governor *cpufreq_opt_governor;
 
 static void __init setup_cpufreq_option(char *str)
 {
@@ -71,19 +70,6 @@ static void __init setup_cpufreq_option(
 }
 custom_param("cpufreq", setup_cpufreq_option);
 
-static void __init setup_cpufreq_gov_option(char *str)
-{
-    if ( !strcmp(str, "userspace") )
-        cpufreq_opt_governor = &cpufreq_gov_userspace;
-    else if ( !strcmp(str, "performance") )
-        cpufreq_opt_governor = &cpufreq_gov_performance;
-    else if ( !strcmp(str, "powersave") )
-        cpufreq_opt_governor = &cpufreq_gov_powersave;
-    else if ( !strcmp(str, "ondemand") )
-        cpufreq_opt_governor = &cpufreq_gov_dbs;
-}
-custom_param("cpufreq_governor", setup_cpufreq_gov_option);
-
 /* Protect updates/reads (resp.) of domain_list and domain_hash. */
 DEFINE_SPINLOCK(domlist_update_lock);
 DEFINE_RCU_READ_LOCK(domlist_read_lock);
xen/drivers/cpufreq/cpufreq.c +45 -0

54 lines not on this page · raw message

xen/drivers/cpufreq/cpufreq_ondemand.c +41 -52

105 lines not on this page · raw message

xen/include/acpi/cpufreq/cpufreq.h +1 -0
@@ -87,6 +87,7 @@ struct cpufreq_governor {
     char    name[CPUFREQ_NAME_LEN];
     int     (*governor)(struct cpufreq_policy *policy,
                         unsigned int event);
+    void    (*handle_option)(const char *name, const char *value);
     struct list_head governor_list;
 };