Skip to content

Commit 4de1a29

Browse files
ldr709KAGA-KOKO
authored andcommitted
futex: Replace spin_is_locked() with lockdep
lockdep_assert_held() is better suited for checking locking requirements, since it won't get confused when the lock is held by some other task. This is also a step towards possibly removing spin_is_locked(). Signed-off-by: Lance Roy <ldr709@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: "Paul E. McKenney" <paulmck@linux.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Darren Hart <dvhart@infradead.org> Link: https://lkml.kernel.org/r/20181003053902.6910-12-ldr709@gmail.com
1 parent 8ca2b56 commit 4de1a29

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
@@ -1365,9 +1365,9 @@ static void __unqueue_futex(struct futex_q *q)
13651365
{
13661366
struct futex_hash_bucket *hb;
13671367

1368-
if (WARN_ON_SMP(!q->lock_ptr || !spin_is_locked(q->lock_ptr))
1369-
|| WARN_ON(plist_node_empty(&q->list)))
1368+
if (WARN_ON_SMP(!q->lock_ptr) || WARN_ON(plist_node_empty(&q->list)))
13701369
return;
1370+
lockdep_assert_held(q->lock_ptr);
13711371

13721372
hb = container_of(q->lock_ptr, struct futex_hash_bucket, lock);
13731373
plist_del(&q->list, &hb->chain);

0 commit comments

Comments
 (0)