lkml.org 
[lkml]   [2016]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/6] cpufreq: schedutil: New governor based on scheduler utilization data
From
Date
On 03/03/16 18:26, Peter Zijlstra wrote:
> On Thu, Mar 03, 2016 at 05:28:55PM +0000, Dietmar Eggemann wrote:
>>> +void arch_scale_freq_tick(void)
>>> +{
>>> + u64 aperf, mperf;
>>> + u64 acnt, mcnt;
>>> +
>>> + if (!static_cpu_has(X86_FEATURE_APERFMPERF))
>>> + return;
>>> +
>>> + aperf = rdmsrl(MSR_IA32_APERF);
>>> + mperf = rdmsrl(MSR_IA32_APERF);
>>> +
>>> + acnt = aperf - this_cpu_read(arch_prev_aperf);
>>> + mcnt = mperf - this_cpu_read(arch_prev_mperf);
>>> +
>>> + this_cpu_write(arch_prev_aperf, aperf);
>>> + this_cpu_write(arch_prev_mperf, mperf);
>>> +
>>> + this_cpu_write(arch_cpu_freq, div64_u64(acnt * SCHED_CAPACITY_SCALE, mcnt));
>>
>> Wasn't there the problem that this ratio goes to zero if the cpu is idle
>> in the old power estimation approach on x86?
>
> Yeah, there was something funky.
>
> SDM says they only count in C0 (ie. !idle), so it _should_ work.

I see, back than the problem was 0 capacity in idle but this is about
frequency.

\
 
 \ /
  Last update: 2016-03-03 21:01    [W:0.097 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site