From: Will Deacon <will.deacon@arm.com>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: linux-kernel@vger.kernel.org, oprofile-list@lists.sf.net,
Robert Richter <robert.richter@amd.com>
Subject: RE: [PATCH] oprofile: add SMP barriers for hrtimer hotplug code
Date: Mon, 31 Jan 2011 17:24:33 +0000 [thread overview]
Message-ID: <1296494673.29209.3.camel@e102144-lin.cambridge.arm.com> (raw)
In-Reply-To: <ce22f38374d26d324bb8e57276eb46f0@mail.gmail.com>
Hi Santosh,
On Mon, 2011-01-31 at 15:41 +0000, Santosh Shilimkar wrote:
> > diff --git a/drivers/oprofile/timer_int.c
> > b/drivers/oprofile/timer_int.c
> > index 0107251..38c1e1b 100644
> > --- a/drivers/oprofile/timer_int.c
> > +++ b/drivers/oprofile/timer_int.c
> > @@ -48,6 +48,7 @@ static int oprofile_hrtimer_start(void)
> > {
> > get_online_cpus();
> > ctr_running = 1;
> > + smp_mb();
> Is smp_wmb() more appropriate ?
>
We could use smp_wmb, but then we have to add smp_rmb before
reading ctr_running too.
> > on_each_cpu(__oprofile_hrtimer_start, NULL, 1);
> > put_online_cpus();
> > return 0;
> > @@ -70,6 +71,7 @@ static void oprofile_hrtimer_stop(void)
> > get_online_cpus();
> > for_each_online_cpu(cpu)
> > __oprofile_hrtimer_stop(cpu);
> > + smp_mb();
> > ctr_running = 0;
> > put_online_cpus();
> > }
I misread this code: it actually all executes on the current CPU so we
don't need the barrier. The control hazard is enough.
> > --
> Otherwise patch is fine.
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Ok, thanks. I will post a v2 anyway with the second barrier removed.
Feel free to re-ack!
Will
prev parent reply other threads:[~2011-01-31 17:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-31 15:08 Will Deacon
2011-01-31 15:41 ` Santosh Shilimkar
2011-01-31 17:24 ` Will Deacon [this message]
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=1296494673.29209.3.camel@e102144-lin.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oprofile-list@lists.sf.net \
--cc=robert.richter@amd.com \
--cc=santosh.shilimkar@ti.com \
/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
all inboxes | Powered by JetHome®