Skip to contentSkip to conversation

locking: Fix mutex debug call and ww_mutex doc

PATCH In review Thomas Hellstrom 3 participants 3 messages Sep 3, 2018 – Sep 10, 2018 Locking primitives

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 locking: Fix mutex debug call and ww_mutex doc

Commit 08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes") introduced a reference in the documentation to a function that was removed in an earlier commit.

It also forgot to remove a call to debug_mutex_add_waiter() which is now unconditionally called by __mutex_add_waiter().

Fix those issues.

Fixes 08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes")
---
 kernel/locking/mutex.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/locking/mutex.c +1 -2
index 1a81a1257b3f..3f8a35104285 100644
@@ -389,7 +389,7 @@ static bool __ww_mutex_wound(struct mutex *lock,
 		/*
 		 * wake_up_process() paired with set_current_state()
 		 * inserts sufficient barriers to make sure @owner either sees
-		 * it's wounded in __ww_mutex_lock_check_stamp() or has a
+		 * it's wounded in __ww_mutex_check_kill() or has a
 		 * wakeup pending to re-read the wounded state.
 		 */
 		if (owner != current)
@@ -946,7 +946,6 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 	}
 
 	debug_mutex_lock_common(lock, &waiter);
-	debug_mutex_add_waiter(lock, &waiter, current);
 
 	lock_contended(&lock->dep_map, ip);
 
Signature · 1 line
2.18.0.rc1
maintainer
#1 lore raw
Quoted 11 lines · Thomas Hellstrom

Commit 08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes") introduced a reference in the documentation to a function that was removed in an earlier commit.

It also forgot to remove a call to debug_mutex_add_waiter() which is now unconditionally called by __mutex_add_waiter().

Fix those issues.

Fixes 08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes")

Thanks!

#2 lore raw

[tip:locking/core] locking/mutex: Fix mutex debug call and ww_mutex documentation

In reply to Thomas Hellstrom
locking/mutex: Fix mutex debug call and ww_mutex documentation
Commit-ID:  e13e2366d8415e029fe96a62502955083e272cef
Gitweb:     https://git.kernel.org/tip/e13e2366d8415e029fe96a62502955083e272cef
Author:     Thomas Hellstrom <[email protected]>
AuthorDate: Mon, 3 Sep 2018 16:07:08 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 10 Sep 2018 10:05:10 +0200

locking/mutex: Fix mutex debug call and ww_mutex documentation

The following commit:

08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes")

introduced a reference in the documentation to a function that was removed in an earlier commit.

It also forgot to remove a call to debug_mutex_add_waiter() which is now unconditionally called by __mutex_add_waiter().

Fix those bugs.

Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes 08295b3b5bee ("Implement an algorithm choice for Wound-Wait mutexes")
---
 kernel/locking/mutex.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/locking/mutex.c +1 -2
index 1a81a1257b3f..3f8a35104285 100644
@@ -389,7 +389,7 @@ static bool __ww_mutex_wound(struct mutex *lock,
 		/*
 		 * wake_up_process() paired with set_current_state()
 		 * inserts sufficient barriers to make sure @owner either sees
-		 * it's wounded in __ww_mutex_lock_check_stamp() or has a
+		 * it's wounded in __ww_mutex_check_kill() or has a
 		 * wakeup pending to re-read the wounded state.
 		 */
 		if (owner != current)
@@ -946,7 +946,6 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 	}
 
 	debug_mutex_lock_common(lock, &waiter);
-	debug_mutex_add_waiter(lock, &waiter, current);
 
 	lock_contended(&lock->dep_map, ip);