[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190107112007-mutt-send-email-mst@kernel.org>
Date: Mon, 7 Jan 2019 11:22:23 -0500
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Jason Wang <jasowang@...hat.com>, linux-kernel@...r.kernel.org,
Alan Stern <stern@...land.harvard.edu>,
Andrea Parri <andrea.parri@...rulasolutions.com>,
Will Deacon <will.deacon@....com>,
Boqun Feng <boqun.feng@...il.com>,
Nicholas Piggin <npiggin@...il.com>,
David Howells <dhowells@...hat.com>,
Jade Alglave <j.alglave@....ac.uk>,
Luc Maranget <luc.maranget@...ia.fr>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Akira Yokosawa <akiyks@...il.com>,
Daniel Lustig <dlustig@...dia.com>, linux-arch@...r.kernel.org,
netdev@...r.kernel.org, virtualization@...ts.linux-foundation.org,
Jonathan Corbet <corbet@....net>,
Richard Henderson <rth@...ddle.net>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
linux-doc@...r.kernel.org, linux-alpha@...r.kernel.org,
linux-sparse@...r.kernel.org
Subject: Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency
On Mon, Jan 07, 2019 at 04:54:23PM +0100, Peter Zijlstra wrote:
> On Mon, Jan 07, 2019 at 08:36:36AM -0500, Michael S. Tsirkin wrote:
> > On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote:
>
> > > How about naming the thing: dependent_ptr() ? That is without any (r)mb
> > > implications at all. The address dependency is strictly weaker than an
> > > rmb in that it will only order the two loads in qestion and not, like
> > > rmb, any prior to any later load.
> >
> > So I'm fine with this as it's enough for virtio, but I would like to point out two things:
> >
> > 1. E.g. on x86 both SMP and DMA variants can be NOPs but
> > the madatory one can't, so assuming we do not want
> > it to be stronger than rmp then either we want
> > smp_dependent_ptr(), dma_dependent_ptr(), dependent_ptr()
> > or we just will specify that dependent_ptr() works for
> > both DMA and SMP.
>
> The latter; the construct simply generates dependent loads. It is up to
> the CPU as to what all that works for.
But not on intel right? On intel loads are ordered so it can be a nop.
> > 2. Down the road, someone might want to order a store after a load.
> > Address dependency does that for us too. Assuming we make
> > dependent_ptr a NOP on x86, we will want an mb variant
> > which isn't a NOP on x86. Will we want to rename
> > dependent_ptr to dependent_ptr_rmb at that point?
>
> Not sure; what is the actual overhead of the construct on x86 vs the
> NOP?
I'll have to check. There's a pipeline stall almost for sure - that's
why we put it there after all :).
--
MST
Powered by blists - more mailing lists