[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 14/09/15 03:32, Wei Wang 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(-)
>
>  changes in v5:
>  1) put this patch prior to the "main body of intel pstate driver", which is 
>     one of the acceptable options suggested by the Jan.
>
> diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
> index 0c437d4..5485944 100644
> --- 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)))

This will be easier to read if you change the location of the linebreak
as such:

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);
>  
> @@ -348,6 +347,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 */
> diff --git a/xen/include/acpi/cpufreq/cpufreq.h 
> b/xen/include/acpi/cpufreq/cpufreq.h
> index c6976d0..48bd94d 100644
> --- a/xen/include/acpi/cpufreq/cpufreq.h
> +++ b/xen/include/acpi/cpufreq/cpufreq.h
> @@ -53,6 +53,12 @@ struct perf_limits {
>      uint32_t min_policy_pct;
>  };
>  
> +struct internal_governor {
> +    char *avail_gov;
> +    uint32_t gov_num;
> +    uint32_t cur_gov;
> +};
> +

Adding this structure needs a mention in the commit message.

~Andrew

_______________________________________________
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®.