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


Groups > linux.kernel > #1272101

Re: [PATCH 4/4] locking: Introduce smp_cond_acquire()

From Will Deacon <will.deacon@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] locking: Introduce smp_cond_acquire()
Date 2015-11-18 12:30 +0100
Message-ID <qw962-2d7-15@gated-at.bofh.it> (permalink)
References (5 earlier) <qvuvU-151-15@gated-at.bofh.it> <qvuPg-1bQ-17@gated-at.bofh.it> <qvzYB-4nO-3@gated-at.bofh.it> <qvN5w-4yq-7@gated-at.bofh.it> <qvVFM-1Tz-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 17, 2015 at 01:01:09PM -0800, Paul E. McKenney wrote:
> On Tue, Nov 17, 2015 at 11:51:10AM +0000, Will Deacon wrote:
> > On Mon, Nov 16, 2015 at 01:58:49PM -0800, Linus Torvalds wrote:
> > > On Mon, Nov 16, 2015 at 8:24 AM, Will Deacon <will.deacon@arm.com> wrote:
> > > >
> > > > ... or we upgrade spin_unlock_wait to a LOCK operation, which might be
> > > > slightly cheaper than spin_lock()+spin_unlock().
> > > 
> > > So traditionally the real concern has been the cacheline ping-pong
> > > part of spin_unlock_wait(). I think adding a memory barrier (that
> > > doesn't force any exclusive states, just ordering) to it is fine, but
> > > I don't think we want to necessarily have it have to get the cacheline
> > > into exclusive state.
> > 
> > The problem is, I don't think the memory-barrier buys you anything in
> > the context of Boqun's example. In fact, he already had smp_mb() either
> > side of the spin_unlock_wait() and its still broken on arm64 and ppc.
> > 
> > Paul is proposing adding a memory barrier after spin_lock() in the racing
> > thread, but I personally think people will forget to add that.
> 
> A mechanical check would certainly make me feel better about it, so that
> any lock that was passed to spin_unlock_wait() was required to have all
> acquisitions followed by smp_mb__after_unlock_lock() or some such.
> But I haven't yet given up on finding a better solution.

Right-o. I'll hack together the arm64 spin_unlock_wait fix, but hold off
merging it for a few weeks in case we get struck by a sudden flash of
inspiration.

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

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


Thread

Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Peter Zijlstra <peterz@infradead.org> - 2015-11-16 17:00 +0100
  Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Peter Zijlstra <peterz@infradead.org> - 2015-11-16 17:10 +0100
    Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Will Deacon <will.deacon@arm.com> - 2015-11-16 17:30 +0100
      Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-11-16 17:50 +0100
        Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Will Deacon <will.deacon@arm.com> - 2015-11-16 17:50 +0100
          Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-11-16 18:20 +0100
      Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-16 23:00 +0100
        Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Will Deacon <will.deacon@arm.com> - 2015-11-17 13:00 +0100
          Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-11-17 22:10 +0100
            Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Will Deacon <will.deacon@arm.com> - 2015-11-18 12:30 +0100
              Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Will Deacon <will.deacon@arm.com> - 2015-11-19 19:10 +0100
                Re: [PATCH 4/4] locking: Introduce smp_cond_acquire() Peter Zijlstra <peterz@infradead.org> - 2015-11-20 11:20 +0100

csiph-web