RE: [PATCH][rfc] intel_pstate: Fix user input of min/max to legal policy region

From: Chen, Yu C
Date: Tue Sep 08 2015 - 22:15:34 EST


Hi ,Rafael

> -----Original Message-----
> From: Rafael J. Wysocki [mailto:rjw@xxxxxxxxxxxxx]
> Sent: Tuesday, September 08, 2015 5:47 AM
> To: Chen, Yu C; kristen@xxxxxxxxxxxxxxx
> Cc: viresh.kumar@xxxxxxxxxx; linux-pm@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; Zhang, Rui; lenb@xxxxxxxxxx
> Subject: Re: [PATCH][rfc] intel_pstate: Fix user input of min/max to legal
> policy region
>
> On Wednesday, August 12, 2015 11:49:19 AM Chen Yu wrote:
> > In current code, if system is using performance policy, user can
> > modify the max_perf_pct to any values lower than 100:
> >
> > $ grep . /sys/devices/system/cpu/intel_pstate/m*_perf_pct
> > /sys/devices/system/cpu/intel_pstate/max_perf_pct:100
> > /sys/devices/system/cpu/intel_pstate/min_perf_pct:100
> >
> > $ echo 80 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
> >
> > $ grep . /sys/devices/system/cpu/intel_pstate/m*_perf_pct
> > /sys/devices/system/cpu/intel_pstate/max_perf_pct:80
> > /sys/devices/system/cpu/intel_pstate/min_perf_pct:100
> >
> > the max_perf_pct above is lower than min_perf_pct, which is not
> > reasonable.
> >
> > This patch solves this problem by clamping min_perf_pct and
> > max_perf_pct to be strictly inside [min_policy_pct,max_policy_pct].
> >
> > Signed-off-by: Chen Yu <yu.c.chen@xxxxxxxxx>
>
> Looks reasonable to me.
>
> Kristen, any objections?
>
Thanks for your reply!
According to suggestion from Seiichi, will re-send a V2 version patch,
to make some update.

Best Regards,
Yu