]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
locking/ww_mutex: Use relaxed atomics
authorPeter Zijlstra <peterz@infradead.org>
Thu, 24 Nov 2016 11:46:26 +0000 (12:46 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 6 Dec 2016 09:42:03 +0000 (10:42 +0100)
The stamp is a sequence number, we don't care about memory ordering.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/ww_mutex.h

index 2bb5deb0012e4434986fbd530c90b3c4d05eb7f2..7b0066814fa001d318f29b8c747ad2ec38e194bc 100644 (file)
@@ -120,7 +120,7 @@ static inline void ww_acquire_init(struct ww_acquire_ctx *ctx,
                                   struct ww_class *ww_class)
 {
        ctx->task = current;
-       ctx->stamp = atomic_long_inc_return(&ww_class->stamp);
+       ctx->stamp = atomic_long_inc_return_relaxed(&ww_class->stamp);
        ctx->acquired = 0;
 #ifdef CONFIG_DEBUG_MUTEXES
        ctx->ww_class = ww_class;