Skip to content

Commit

Permalink
futex: Fix barrier comment
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Davidlohr Bueso authored and Thomas Gleixner committed Feb 8, 2019
1 parent 74e9671 commit 6f568eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6f568eb

Please sign in to comment.