[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 5/9] x86/intel_pstate: changes in cpufreq_del_cpu for CPU offline



On 07/10/2015 23:29,  Jan Beulich wrote:
> >>> On 14.09.15 at 04:32, <wei.w.wang@xxxxxxxxx> 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().
> >
> > Signed-off-by: Wei Wang <wei.w.wang@xxxxxxxxx>
> > ---
> >  xen/drivers/cpufreq/cpufreq.c      | 6 +++---
> >  xen/include/acpi/cpufreq/cpufreq.h | 7 +++++++
> >  2 files changed, 10 insertions(+), 3 deletions(-)
> >
> > --- a/xen/drivers/cpufreq/cpufreq.c
> > +++ b/xen/drivers/cpufreq/cpufreq.c
> > @@ -334,12 +334,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;
> 
> Prior to this line we still have policy == per_cpu(cpufreq_cpu_policy, cpu), 
> i.e.
> the data needed is being made available to the ->exit() handler called a few 
> lines
> down. I.e. if you want to convince me or anyone else that the change is 
> needed,
> you will need to say in the description why that is not enough.
> 

OK. Without this patch, we need to change intel_pstate_set_pstate() to receive 
the "policy" parameter from ->exit(), instead of referencing the global 
per_cpu() variable. The cumbersome part is that we need to change all other 
callers of intel_pstate_set_pstate() to get the "policy" parameter as well and 
pass it to the intel_pstate_set_pstate() function. I will include this change 
in the next version to see if this way is better.

Best,
Wei



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.