[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180522105624.ttd6isx7c2ylgzqy@vireshk-i7>
Date: Tue, 22 May 2018 16:26:24 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Patrick Bellasi <patrick.bellasi@....com>
Cc: "Joel Fernandes (Google.)" <joelaf@...gle.com>,
linux-kernel@...r.kernel.org,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Luca Abeni <luca.abeni@...tannapisa.it>,
Todd Kjos <tkjos@...gle.com>, claudio@...dence.eu.com,
kernel-team@...roid.com, linux-pm@...r.kernel.org
Subject: Re: [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
Powered by blists - more mailing lists