Skip to content

Commit 6f568eb

Browse files
Davidlohr BuesoKAGA-KOKO
authored andcommitted
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
1 parent 74e9671 commit 6f568eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/futex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,11 +2221,11 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
22212221
* decrement the counter at queue_unlock() when some error has
22222222
* occurred and we don't end up adding the task to the list.
22232223
*/
2224-
hb_waiters_inc(hb);
2224+
hb_waiters_inc(hb); /* implies smp_mb(); (A) */
22252225

22262226
q->lock_ptr = &hb->lock;
22272227

2228-
spin_lock(&hb->lock); /* implies smp_mb(); (A) */
2228+
spin_lock(&hb->lock);
22292229
return hb;
22302230
}
22312231

0 commit comments

Comments
 (0)