Skip to contentSkip to conversation

x86/intel_pstate: changes in cpufreq_del_cpu for CPU offline

PATCH Superseded Wei Wang 2 participants 2 messages Jun 25, 2015 – Jul 24, 2015

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Wei Wang

author
#0 lore raw

PATCH v4 8/11 x86/intel_pstate: changes in cpufreq_del_cpu for CPU offline

We change to NULL the cpufreq_cpu_policy pointer after the call of cpufreq_driver->exit, because the pointer is still needed in intel_pstate_set_pstate().

v4 changes:
None.

---
 xen/drivers/cpufreq/cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
xen/drivers/cpufreq/cpufreq.c +3 -3
index acc4bb5..d1b423f 100644
@@ -335,12 +335,11 @@ int cpufreq_del_cpu(unsigned int cpu)
 
     /* for HW_ALL, stop gov for each core of the _PSD domain */
     /* for SW_ALL & SW_ANY, stop gov for the 1st core of the _PSD domain */
-    if (hw_all || (cpumask_weight(cpufreq_dom->map) ==
-                   perf->domain_info.num_processors))
+    if (!policy->internal_gov && (hw_all || (cpumask_weight(cpufreq_dom->map) ==
+                   perf->domain_info.num_processors)))
         __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
 
     cpufreq_statistic_exit(cpu);
-    per_cpu(cpufreq_cpu_policy, cpu) = NULL;
     cpumask_clear_cpu(cpu, policy->cpus);
     cpumask_clear_cpu(cpu, cpufreq_dom->map);
 
@@ -349,6 +348,7 @@ int cpufreq_del_cpu(unsigned int cpu)
         free_cpumask_var(policy->cpus);
         xfree(policy);
     }
+    per_cpu(cpufreq_cpu_policy, cpu) = NULL;
 
     /* for the last cpu of the domain, clean room */
     /* It's safe here to free freq_table, drv_data and policy */
Signature · 1 line
1.9.1
#1 lore raw
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 25.06.15 at 13:16, <[email protected]> wrote:

We change to NULL the cpufreq_cpu_policy pointer after the call of cpufreq_driver->exit, because the pointer is still needed in intel_pstate_set_pstate().

Just to continue from where I finished on the previous patch: This is an acceptable change if the goal is for intel_pstate.c to be minimally different from its Linux original. As said in a reply to an earlier version, since it can be done differently (i.e. without doing what you do here), I don't view it as acceptable if the delta of the two files is as big as it is right now.

Jan