locking/rtmutex: Fix misleading comment
Peter Zijlstra
maintainerPATCH 1/1 locking/rtmutex: Fix misleading comment
Going through the RCU-boost and rtmutex code, I ran into this utterly confusing comment. Fix it to avoid confusing future readers.
---
kernel/locking/rtmutex_api.c +1 -1
@@ -175,7 +175,7 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex_base *lock, }/* -* We've already deboosted, mark_wakeup_next_waiter() will +* This will deboost, mark_wakeup_next_waiter() will * retain preempt_disabled when we drop the wait_lock, to * avoid inversion prior to the wakeup. preempt_disable() * therein pairs with rt_mutex_postunlock().
Quoted 3 lines · Peter Zijlstra
Going through the RCU-boost and rtmutex code, I ran into this utterly confusing comment. Fix it to avoid confusing future readers.
Correct.
kernel/locking/rtmutex_api.c bool __sched __rt_mutex_futex_unlock(struct rt_mutex_base *lock, · line 178
Quoted 12 lines
Signed-off-by Peter Zijlstra (Intel) <[email protected]>---
kernel/locking/rtmutex_api.c +1
-1@@ -175,7 +175,7 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex_base *lock, }/* -* We've already deboosted, mark_wakeup_next_waiter() will +* This will deboost, mark_wakeup_next_waiter() will
+ * mark_wakeup_next_waiter() will deboost and
kernel/locking/rtmutex_api.c bool __sched __rt_mutex_futex_unlock(struct rt_mutex_base *lock, · line 181
Quoted 3 lines
kernel/locking/rtmutex_api.c +0
-0* retain preempt_disabled when we drop the wait_lock, to * avoid inversion prior to the wakeup. preempt_disable() * therein pairs with rt_mutex_postunlock().
This could make it obvious that mark_wakeup_next_waiter() does all the things.
Sebastian
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: d12b802f183667d4c28589314c99c380a458d57e Gitweb: https://git.kernel.org/tip/d12b802f183667d4c28589314c99c380a458d57e Author: Peter Zijlstra <[email protected]> AuthorDate: Tue, 08 Oct 2024 11:26:06 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 24 Oct 2024 23:03:30 +02:00
locking/rtmutex: Fix misleading comment
Going through the RCU-boost and rtmutex code, I ran into this utterly confusing comment. Fix it to avoid confusing future readers.
[ tglx: Wordsmithed the comment ]
--- kernel/locking/rtmutex_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/locking/rtmutex_api.c +4 -4
@@ -175,10 +175,10 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex_base *lock, }/* -* We've already deboosted, mark_wakeup_next_waiter() will -* retain preempt_disabled when we drop the wait_lock, to -* avoid inversion prior to the wakeup. preempt_disable() -* therein pairs with rt_mutex_postunlock(). +* mark_wakeup_next_waiter() deboosts and retains preemption +* disabled when dropping the wait_lock, to avoid inversion prior +* to the wakeup. preempt_disable() therein pairs with the +* preempt_enable() in rt_mutex_postunlock(). */ mark_wakeup_next_waiter (wqh, lock);