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


Groups > linux.kernel > #1412386

Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait()
Date 2016-06-02 18:10 +0200
Message-ID <rFDm1-82K-7@gated-at.bofh.it> (permalink)
References <rFzs5-5tU-7@gated-at.bofh.it> <rFzs6-5tU-37@gated-at.bofh.it> <rFBNg-71V-43@gated-at.bofh.it> <rFC6B-78u-5@gated-at.bofh.it> <rFCpX-7tY-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jun 02, 2016 at 11:11:07PM +0800, Boqun Feng wrote:
> On Thu, Jun 02, 2016 at 04:44:24PM +0200, Peter Zijlstra wrote:
> > Let me go ponder that some :/
> > 
> 
> An intial thought of the fix is making queued_spin_unlock_wait() an
> atomic-nop too:
> 
> static inline void queued_spin_unlock_wait(struct qspinlock *lock)
> {
> 	struct __qspinlock *l = (struct __qspinlock *)lock;
> 	
> 	while (!cmpxchg(&l->locked, 0, 0))
> 		cpu_relax();
> }
> 
> This could make queued_spin_unlock_wait() a WRITE, with a smp_mb()
> preceding it, it would act like a RELEASE, which can be paired with
> spin_lock().
> 
> Just food for thought. ;-)

Not sure that'll actually work. The qspinlock store is completely
unordered and not part of a ll/sc or anything like that.

Doing competing stores might even result in loosing it entirely.

But I think I got something.. Lemme go test it :-)

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


Thread

[PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-02 14:00 +0200
  Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Boqun Feng <boqun.feng@gmail.com> - 2016-06-02 16:30 +0200
    Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-02 16:50 +0200
      Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Boqun Feng <boqun.feng@gmail.com> - 2016-06-02 17:10 +0200
        Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Boqun Feng <boqun.feng@gmail.com> - 2016-06-02 18:00 +0200
        Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-02 18:10 +0200
      Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-02 18:40 +0200
        Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Will Deacon <will.deacon@arm.com> - 2016-06-02 20:00 +0200
          Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-03 00:00 +0200
            Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Will Deacon <will.deacon@arm.com> - 2016-06-03 14:50 +0200
              Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-03 15:50 +0200
                Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Will Deacon <will.deacon@arm.com> - 2016-06-03 19:40 +0200
                Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-03 21:20 +0200
              Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-03 15:50 +0200
          Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-06 18:10 +0200
            Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Boqun Feng <boqun.feng@gmail.com> - 2016-06-07 13:50 +0200
              Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-07 14:10 +0200
                Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Boqun Feng <boqun.feng@gmail.com> - 2016-06-07 14:50 +0200
                Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Peter Zijlstra <peterz@infradead.org> - 2016-06-07 19:40 +0200

csiph-web