summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2019-02-06 19:56:02 +0100
committerThomas Gleixner <tglx@linutronix.de>2019-02-08 13:00:35 +0100
commit6f568ebe2afefdc33a6fb06ef20a94f8b96455f1 (patch)
treef759c5a15e81839f297993fbf55c3735b61b51da
parentMerge tag 'platform-drivers-x86-v5.0-2' of git://git.infradead.org/linux-plat... (diff)
downloadlinux-6f568ebe2afefdc33a6fb06ef20a94f8b96455f1.tar.xz
linux-6f568ebe2afefdc33a6fb06ef20a94f8b96455f1.zip
futex: Fix barrier comment
The current comment for the barrier that guarantees that waiter increment is always before taking the hb spinlock (barrier (A)) needs to be fixed as it is misplaced. This is obviously referring to hb_waiters_inc, which is a full barrier. Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190206185602.949-1-dave@stgolabs.net
-rw-r--r--kernel/futex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index fdd312da0992..5ec2473a3497 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2221,11 +2221,11 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
* decrement the counter at queue_unlock() when some error has
* occurred and we don't end up adding the task to the list.
*/
- hb_waiters_inc(hb);
+ hb_waiters_inc(hb); /* implies smp_mb(); (A) */
q->lock_ptr = &hb->lock;
- spin_lock(&hb->lock); /* implies smp_mb(); (A) */
+ spin_lock(&hb->lock);
return hb;
}