From: Andrea Parri <andrea.parri@amarulasolutions.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
rjw@rjwysocki.net, linux-kernel@vger.kernel.org,
Eduardo Valentin <edubezval@gmail.com>,
Javi Merino <javi.merino@kernel.org>,
Leo Yan <leo.yan@linaro.org>,
Kevin Wangtao <kevin.wangtao@linaro.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Rui Zhang <rui.zhang@intel.com>,
Daniel Thompson <daniel.thompson@linaro.org>,
"open list:POWER MANAGEMENT CORE" <linux-pm@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH V5] powercap/drivers/idle_injection: Add an idle injection framework
Date: Wed, 6 Jun 2018 14:05:39 +0200 [thread overview]
Message-ID: <20180606120539.GA13130@andrea> (raw)
In-Reply-To: <20180606104528.nhwcd2qnxeouk6il@vireshk-i7>
Hi Daniel, Viresh,
On Wed, Jun 06, 2018 at 04:15:28PM +0530, Viresh Kumar wrote:
> On 06-06-18, 12:22, Daniel Lezcano wrote:
> > (mb() are done in the atomic operations AFAICT).
To do my bit, not all atomic ops do/imply memory barriers; e.g.,
[from Documentation/atomic_t.txt]
- non-RMW operations [e.g., atomic_set()] are unordered
- RMW operations that have no return value [e.g., atomic_inc()] are unordered
>
> AFAIU, it is required to make sure the operations are seen in a particular order
> on another CPU and the compiler doesn't reorganize code to optimize it.
>
> For example, in our case what if the compiler reorganizes the atomic-set
> operation after wakeup-process ? But maybe that wouldn't happen across function
> calls and we should be safe then.
IIUC, wake_up_process() implies a full memory barrier and a compiler barrier,
due to:
raw_spin_lock_irqsave(&p->pi_lock, flags);
smp_mb__after_spinlock();
The pattern under discussion isn't clear to me, but if you'll end up relying
on this "implicit" barrier I'd suggest documenting it with a comment.
Andrea
next prev parent reply other threads:[~2018-06-06 12:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 9:16 [PATCH V5] powercap/drivers/idle_injection: Add an idle injection framework Daniel Lezcano
2018-06-05 10:39 ` Viresh Kumar
2018-06-05 14:54 ` Daniel Lezcano
2018-06-06 4:27 ` Viresh Kumar
2018-06-06 10:22 ` Daniel Lezcano
2018-06-06 10:45 ` Viresh Kumar
2018-06-06 12:05 ` Andrea Parri [this message]
2018-06-06 12:29 ` Peter Zijlstra
2018-06-07 14:11 ` Daniel Lezcano
2018-06-08 4:48 ` Viresh Kumar
2018-06-08 8:31 ` Daniel Lezcano
2018-06-06 12:23 ` Peter Zijlstra
2018-06-06 13:42 ` Daniel Lezcano
2018-06-06 15:02 ` Peter Zijlstra
2018-06-07 8:18 ` Daniel Lezcano
2018-06-07 8:32 ` Peter Zijlstra
2018-06-07 8:42 ` Viresh Kumar
2018-06-07 8:46 ` Daniel Lezcano
2018-06-07 8:49 ` Viresh Kumar
2018-06-07 9:09 ` Daniel Lezcano
2018-06-07 9:32 ` Peter Zijlstra
2018-06-07 9:39 ` Peter Zijlstra
2018-06-07 12:31 ` Daniel Lezcano
2018-06-07 9:09 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180606120539.GA13130@andrea \
--to=andrea.parri@amarulasolutions.com \
--cc=daniel.lezcano@linaro.org \
--cc=daniel.thompson@linaro.org \
--cc=edubezval@gmail.com \
--cc=javi.merino@kernel.org \
--cc=kevin.wangtao@linaro.org \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox