lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1296494673.29209.3.camel@e102144-lin.cambridge.arm.com>
Date:	Mon, 31 Jan 2011 17:24:33 +0000
From:	Will Deacon <will.deacon@....com>
To:	Santosh Shilimkar <santosh.shilimkar@...com>
Cc:	linux-kernel@...r.kernel.org, oprofile-list@...ts.sf.net,
	Robert Richter <robert.richter@....com>
Subject: RE: [PATCH] oprofile: add SMP barriers for hrtimer hotplug code

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@...com>

Ok, thanks. I will post a v2 anyway with the second barrier removed.
Feel free to re-ack!

Will



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ