locking: Remove ACCESS_ONCE() usage
authorDavidlohr Bueso <dave@stgolabs.net>
Mon, 23 Feb 2015 03:31:41 +0000 (19:31 -0800)
committerIngo Molnar <mingo@kernel.org>
Tue, 24 Feb 2015 07:44:16 +0000 (08:44 +0100)
commit4d3199e4ca8e6670b54dc5ee070ffd54385988e9
tree5529bcb16c3217c02416e0d17d7c28f277c63581
parent2ae79026818e7d49fead82b79b1a543e3b9c8a23
locking: Remove ACCESS_ONCE() usage

With the new standardized functions, we can replace all
ACCESS_ONCE() calls across relevant locking - this includes
lockref and seqlock while at it.

ACCESS_ONCE() does not work reliably on non-scalar types.
For example gcc 4.6 and 4.7 might remove the volatile tag
for such accesses during the SRA (scalar replacement of
aggregates) step:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145

Update the new calls regardless of if it is a scalar type,
this is cleaner than having three alternatives.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1424662301.6539.18.camel@stgolabs.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/seqlock.h
kernel/locking/mcs_spinlock.h
kernel/locking/mutex.c
kernel/locking/osq_lock.c
kernel/locking/rwsem-xadd.c
lib/lockref.c