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>
Showing
- include/linux/seqlock.h 3 additions, 3 deletionsinclude/linux/seqlock.h
- kernel/locking/mcs_spinlock.h 3 additions, 3 deletionskernel/locking/mcs_spinlock.h
- kernel/locking/mutex.c 4 additions, 4 deletionskernel/locking/mutex.c
- kernel/locking/osq_lock.c 7 additions, 7 deletionskernel/locking/osq_lock.c
- kernel/locking/rwsem-xadd.c 5 additions, 5 deletionskernel/locking/rwsem-xadd.c
- lib/lockref.c 1 addition, 1 deletionlib/lockref.c
Loading
Please register or sign in to comment