[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131028092259.GJ19466@laptop.lan>
Date: Mon, 28 Oct 2013 10:22:59 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Victor Kaplansky <VICTORK@...ibm.com>
Cc: anton@...ba.org, benh@...nel.crashing.org,
Frederic Weisbecker <fweisbec@...il.com>,
linux-kernel@...r.kernel.org,
Linux PPC dev <linuxppc-dev@...abs.org>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
michael@...erman.id.au, Michael Neuling <mikey@...ling.org>
Subject: Re: perf events ring buffer memory barrier on powerpc
On Sun, Oct 27, 2013 at 11:00:33AM +0200, Victor Kaplansky wrote:
> Peter Zijlstra <peterz@...radead.org> wrote on 10/25/2013 07:37:49 PM:
>
> > I would argue for:
> >
> > READ ->data_tail READ ->data_head
> > smp_rmb() (A) smp_rmb() (C)
> > WRITE $data READ $data
> > smp_wmb() (B) smp_mb() (D)
> > STORE ->data_head WRITE ->data_tail
> >
> > Where A pairs with D, and B pairs with C.
>
> 1. I agree. My only concern is that architectures which do use atomic
> operations
> with memory barriers, will issue two consecutive barriers now, which is
> sub-optimal.
Yeah, although that would be fairly easy to optimize by the CPUs itself;
not sure they actually do this though.
But we don't really have much choice aside of introducing things like:
smp_wmb__after_local_$op; and I'm fairly sure people won't like adding a
ton of conditional barriers like that either.
> 2. I think the comment in "include/linux/perf_event.h" describing
> "data_head" and
> "data_tail" for user space need an update as well. Current version -
Oh, indeed. Thanks; I'll update that too!
--
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