lkml.org 
[lkml]   [2015]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] cpufreq, intel_pstate, Fix limits->max_policy_pct rounding error


On 11/20/2015 10:19 AM, Viresh Kumar wrote:
> On 20-11-15, 10:10, Prarit Bhargava wrote:
>>>> limits->max_policy_pct = clamp_t(int, limits->max_policy_pct, 0 , 100);
>>>
>>> And put this after the later one ?
>>>
>>>> + limits->max_policy_pct = DIV_ROUND_UP(policy->max * 100,
>>>> + policy->cpuinfo.max_freq);
>>>>
>>>> /* Normalize user input to [min_policy_pct, max_policy_pct] */
>>>> limits->min_perf_pct = max(limits->min_policy_pct,
>>>
>>> Sure you tested it ? :)
>>
>> Oops -- and yeah, tested. It works because I rewrite the value of
>> max_policy_pct :). I'll repost shortly.
>
> But we aren't doing below anymore, doesn't this change the
> calculations at all?
>
> limits->max_policy_pct = clamp_t(int, limits->max_policy_pct, 0 , 100);

The clamp only confines the max_policy between 0 and 100. AFAIK it doesn't make
any change tothe value of limits->max_policy_pct unless it was outside of that
range.

P.
>


\
 
 \ /
  Last update: 2015-11-20 17:01    [W:1.075 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site