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


Groups > linux.kernel > #1471429

Re: [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h

From Manfred Spraul <manfred@colorfullife.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h
Date 2016-08-28 20:10 +0200
Message-ID <sbcGS-52W-27@gated-at.bofh.it> (permalink)
References <sb6UO-1cS-7@gated-at.bofh.it> <sb6UO-1cS-9@gated-at.bofh.it> <sb6UO-1cS-11@gated-at.bofh.it> <sb8Df-2mx-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/28/2016 03:43 PM, Paul E. McKenney wrote:
>
>> Without the smp_mb__after_unlock_lock(), other CPUs can observe the
>> write to d without seeing the write to a.
>>
>> Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
> With the upgraded commit log, I am OK with the patch below.
Done.
> However, others will probably want to see at least one use of
> smp_mb__after_unlock_lock() outside of RCU.
I would look at it from the other side:
There are at least half a dozen hardware/spinlock implementations that 
must support rcu.
And for half a dozen implementations, a global header file makes sense, 
regardless of the number of users.

With this in the global header file
 > #ifndef complex_memory_barrier()
 > #define complex_memory_barrier()    always_safe_fallback()
 > #endif

it is easier for the architectures to support rcu, ipc/sem and nf_conntrack.
Especially if everything is (as it is now) in <linux/spinlock.h>

--
     Manfred

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


Thread

[PATCH 0/4] Clarify/standardize memory barriers for lock/unlock Manfred Spraul <manfred@colorfullife.com> - 2016-08-28 14:00 +0200
  [PATCH 1/4] spinlock: Document memory barrier rules Manfred Spraul <manfred@colorfullife.com> - 2016-08-28 14:00 +0200
    [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h Manfred Spraul <manfred@colorfullife.com> - 2016-08-28 14:00 +0200
      Re: [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to  barrier.h "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-28 15:50 +0200
        [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to barrier.h Manfred Spraul <manfred@colorfullife.com> - 2016-08-28 18:40 +0200
        Re: [PATCH 2/4] barrier.h: Move smp_mb__after_unlock_lock to  barrier.h Manfred Spraul <manfred@colorfullife.com> - 2016-08-28 20:10 +0200
    Re: [PATCH 1/4] spinlock: Document memory barrier rules Peter Zijlstra <peterz@infradead.org> - 2016-08-29 12:50 +0200
      Re: [PATCH 1/4] spinlock: Document memory barrier rules Manfred Spraul <manfred@colorfullife.com> - 2016-08-29 15:00 +0200
        Re: [PATCH 1/4] spinlock: Document memory barrier rules Peter Zijlstra <peterz@infradead.org> - 2016-08-29 15:50 +0200
          Re: [PATCH 1/4] spinlock: Document memory barrier rules Manfred Spraul <manfred@colorfullife.com> - 2016-08-31 07:00 +0200
            Re: [PATCH 1/4] spinlock: Document memory barrier rules Peter Zijlstra <peterz@infradead.org> - 2016-08-31 17:50 +0200
              Re: [PATCH 1/4] spinlock: Document memory barrier rules Will Deacon <will.deacon@arm.com> - 2016-08-31 18:50 +0200
                Re: [PATCH 1/4] spinlock: Document memory barrier rules Manfred Spraul <manfred@colorfullife.com> - 2016-08-31 20:40 +0200
                Re: [PATCH 1/4] spinlock: Document memory barrier rules Peter Zijlstra <peterz@infradead.org> - 2016-09-01 10:50 +0200
                Re: [PATCH 1/4] spinlock: Document memory barrier rules Manfred Spraul <manfred@colorfullife.com> - 2016-09-01 13:10 +0200
                Re: [PATCH 1/4] spinlock: Document memory barrier rules Will Deacon <will.deacon@arm.com> - 2016-09-01 13:20 +0200
                Re: [PATCH 1/4] spinlock: Document memory barrier rules Peter Zijlstra <peterz@infradead.org> - 2016-09-01 14:00 +0200
                Re: [PATCH 1/4] spinlock: Document memory barrier rules Boqun Feng <boqun.feng@gmail.com> - 2016-09-01 16:10 +0200
  Re: [PATCH 0/4] Clarify/standardize memory barriers for lock/unlock Peter Zijlstra <peterz@infradead.org> - 2016-08-29 13:00 +0200

csiph-web