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

Re: [Xen-devel] [PATCH v3 03/11] x86/intel_pstate: add new policy fields and a new driver interface



>>> On 11.06.15 at 10:26, <wei.w.wang@xxxxxxxxx> wrote:
> --- a/xen/drivers/cpufreq/utility.c
> +++ b/xen/drivers/cpufreq/utility.c
> @@ -457,6 +457,12 @@ int __cpufreq_set_policy(struct cpufreq_policy *data,
>      data->min = policy->min;
>      data->max = policy->max;
>  
> +    if (cpufreq_driver->setpolicy) {
> +        data->limits.min_perf_pct = policy->limits.min_perf_pct;
> +        data->limits.max_perf_pct = policy->limits.max_perf_pct;

For one you leave all other data->limits fields uninitialized - please
use "data->limits = policy->limits". And then I don't see why this
should be done inside the if() - there's no obvious connection
between ->setpolicy being non-NULL and ->limits having meaning
to the driver - this is solely your intended _use_ model.

> --- a/xen/include/acpi/cpufreq/cpufreq.h
> +++ b/xen/include/acpi/cpufreq/cpufreq.h
> @@ -41,6 +41,18 @@ struct cpufreq_cpuinfo {
>      unsigned int        transition_latency; /* in 10^(-9) s = nanoseconds */
>  };
>  
> +struct perf_limits {
> +    int no_turbo;
> +    int turbo_disabled;

Both bool_t I suppose.

> @@ -52,6 +64,8 @@ struct cpufreq_policy {
>      unsigned int        max;    /* in kHz */
>      unsigned int        cur;    /* in kHz, only needed if cpufreq
>                                   * governors are used */
> +    unsigned int        policy;

This field isn't being used anywhere here. Please add it upon first use.

Jan


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