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

Manfred Spraul
2016-08-28T18:00:54Z

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