diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-12-11 22:59:08 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-12-16 11:36:13 +0100 |
commit | 01352fb81658cbf78c55844de8e3d1d606bbf3f8 (patch) | |
tree | e28e262f32512fdbead9011e33fad9f679326d94 /fs/char_dev.c | |
parent | Documentation/memory-barriers.txt: Document ACCESS_ONCE() (diff) | |
download | linux-01352fb81658cbf78c55844de8e3d1d606bbf3f8.tar.xz linux-01352fb81658cbf78c55844de8e3d1d606bbf3f8.zip |
locking: Add an smp_mb__after_unlock_lock() for UNLOCK+BLOCK barrier
The Linux kernel has traditionally required that an UNLOCK+LOCK
pair act as a full memory barrier when either (1) that
UNLOCK+LOCK pair was executed by the same CPU or task, or (2)
the same lock variable was used for the UNLOCK and LOCK. It now
seems likely that very few places in the kernel rely on this
full-memory-barrier semantic, and with the advent of queued
locks, providing this semantic either requires complex
reasoning, or for some architectures, added overhead.
This commit therefore adds a smp_mb__after_unlock_lock(), which
may be placed after a LOCK primitive to restore the
full-memory-barrier semantic. All definitions are currently
no-ops, but will be upgraded for some architectures when queued
locks arrive.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <linux-arch@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1386799151-2219-5-git-send-email-paulmck@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/char_dev.c')
0 files changed, 0 insertions, 0 deletions