Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1385566

Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait()

From Boqun Feng <boqun.feng@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait()
Date 2016-04-23 05:40 +0200
Message-ID <rqWAi-4FI-9@gated-at.bofh.it> (permalink)
References <rkbXs-31q-9@gated-at.bofh.it> <rkbXs-31q-7@gated-at.bofh.it> <rn9Ps-27p-23@gated-at.bofh.it> <rqLOy-4Dw-15@gated-at.bofh.it> <rqVEe-3Uw-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sat, Apr 23, 2016 at 04:37:36AM +0200, Peter Zijlstra wrote:
> On Sat, Apr 23, 2016 at 12:08:57AM +0800, Boqun Feng wrote:
> > How about replace smp_rmb() with a smp_acquire_barrier__after_cmpwait()?
> > This barrier is designed to provide an ACQUIRE ordering when combining a
> > cmpwait() .
> 
> That's a horrible name for a barrier :-)
> 

Indeed, and having another special barrier is a pain.

> > And cmpwait() only has minimal ordering guarantee, but if it is actually
> > an ACQUIRE, then the corresponding smp_acquire_barrier__after_cmpwait()
> > is just empty.
> > 
> > We might need this special barrier on ppc, because we can implement it
> > with "isync" given that cmpwait() has control dependency and ctrl+isync
> > is ACQUIRE on ppc.
> > 
> > Thoughts?
> 
> Provide a PPC specific smp_cond_load_acquire() using ISYNC ?

That works, but I should do more investigation on that, I brought this
up because ISYNC may be better than smp_rmb() in two cases, IIUC:

1.	for old systems without LWSYNC, smp_rmb() is actually SYNC,
	which is heavier than ISYNC.

2.	for new systems, isync may be a little faster than lwsync,
	according to Michael Ellerman: http://lkml.kernel.org/g/1437012028.28475.2.camel@ellerman.id.au

but I doubt these two cases will have any observed performance impact,
so the current version of smp_cond_load_acquire() in your patch is fine,
and we can switch to a specific one in the future we want to ;-)

Regards,
Boqun

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Boqun Feng <boqun.feng@gmail.com> - 2016-04-22 18:10 +0200
  Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Will Deacon <will.deacon@arm.com> - 2016-04-22 19:00 +0200
    Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Boqun Feng <boqun.feng@gmail.com> - 2016-04-23 06:00 +0200
  Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Peter Zijlstra <peterz@infradead.org> - 2016-04-23 04:40 +0200
    Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Boqun Feng <boqun.feng@gmail.com> - 2016-04-23 05:40 +0200

csiph-web