lkml.org 
[lkml]   [2023]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/3] cpufreq: CPPC: Eliminate the impact of cpc_read() latency error
From

在 2023/10/25 19:01, Mark Rutland 写道:
> On Wed, Oct 25, 2023 at 05:38:47PM +0800, Zeng Heng wrote:
>
> The previous patch added this function, and calls it with smp_call_on_cpu(),
> where it'll run in IRQ context with IRQs disabled...

smp_call_on_cpu() puts the work to the bind-cpu worker.

And this function will be called in task context, and IRQs is certainly enabled.


Zeng Heng

>> struct fb_ctr_pair *fb_ctrs = val;
>> int cpu = fb_ctrs->cpu;
>> int ret;
>> + unsigned long timeout;
>>
>> ret = cppc_get_perf_ctrs(cpu, &fb_ctrs->fb_ctrs_t0);
>> if (ret)
>> return ret;
>>
>> - udelay(2); /* 2usec delay between sampling */
>> + if (likely(!irqs_disabled())) {
>> + /*
>> + * Set 1ms as sampling interval, but never schedule
>> + * to the idle task to prevent the AMU counters from
>> + * stopping working.
>> + */
>> + timeout = jiffies + msecs_to_jiffies(1);
>> + while (!time_after(jiffies, timeout))
>> + cond_resched();
>> +
>> + } else {
> ... so we'll enter this branch of the if-else ...
>
>> + pr_warn_once("CPU%d: Get rate in atomic context", cpu);
> ... and pr_warn_once() for something that's apparently normal and outside of
> the user's control?
>
> That doesn't make much sense to me.
>
> Mark.
>
>> + udelay(2); /* 2usec delay between sampling */
>> + }
>>
>> return cppc_get_perf_ctrs(cpu, &fb_ctrs->fb_ctrs_t1);
>> }
>> --
>> 2.25.1
>>

\
 
 \ /
  Last update: 2023-10-26 03:56    [W:0.043 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site