lkml.org 
[lkml]   [2018]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] schedutil: Allow cpufreq requests to be made even when kthread kicked
On 22-05-18, 11:51, Patrick Bellasi wrote:
> It could happen, but using:
>
> raw_spin_lock_irqsave(&sg_policy->update_lock, flags);
> freq = READ_ONCE(sg_policy->next_freq)
> WRITE_ONCE(sg_policy->work_in_progress, false);
> raw_spin_unlock_irqrestore(&sg_policy->update_lock, flags);
>
> if (!READ_ONCE(sg_policy->work_in_progress)) {
> WRITE_ONCE(sg_policy->work_in_progress, true);
> irq_work_queue(&sg_policy->irq_work);
> }

I think its better to get locking in place for non-fast switching case in
single-policy systems right now.

> should fix it by enforcing the ordering as well as documenting the
> concurrent access.
>
> However, in the "sched update" side, where do we have the sequence:
>
> sg_policy->next_freq = 0;
> sg_policy->next_freq = real-next-freq;

Ah, that was just an example of what a compiler may do (though it shouldn't do).

--
viresh

\
 
 \ /
  Last update: 2018-05-22 12:59    [W:0.090 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site