mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] locking/rtmutex: Fix misleading comment
@ 2024-10-08  9:26 Peter Zijlstra
  2024-10-08 10:50 ` Sebastian Andrzej Siewior
  2024-10-24 21:07 ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Zijlstra @ 2024-10-08  9:26 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: linux-kernel, mingo, will, longman, boqun.feng,
	Sebastian Andrzej Siewior, Peter Zijlstra


Going through the RCU-boost and rtmutex code, I ran into this utterly
confusing comment. Fix it to avoid confusing future readers.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
index a6974d044593..587ede8073c0 100644
--- a/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -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().

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] locking/rtmutex: Fix misleading comment
  2024-10-08  9:26 [PATCH] locking/rtmutex: Fix misleading comment Peter Zijlstra
@ 2024-10-08 10:50 ` Sebastian Andrzej Siewior
  2024-10-24 21:07 ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-10-08 10:50 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Thomas Gleixner, linux-kernel, mingo, will, longman, boqun.feng

On 2024-10-08 11:26:06 [+0200], Peter Zijlstra wrote:
> 
> Going through the RCU-boost and rtmutex code, I ran into this utterly
> confusing comment. Fix it to avoid confusing future readers.

Correct.

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
> index a6974d044593..587ede8073c0 100644
> --- a/kernel/locking/rtmutex_api.c
> +++ b/kernel/locking/rtmutex_api.c
> @@ -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
>  	 * 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: locking/core] locking/rtmutex: Fix misleading comment
  2024-10-08  9:26 [PATCH] locking/rtmutex: Fix misleading comment Peter Zijlstra
  2024-10-08 10:50 ` Sebastian Andrzej Siewior
@ 2024-10-24 21:07 ` tip-bot2 for Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Peter Zijlstra @ 2024-10-24 21:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Peter Zijlstra (Intel),
	Thomas Gleixner, Sebastian Andrzej Siewior, x86, linux-kernel

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 <peterz@infradead.org>
AuthorDate:    Tue, 08 Oct 2024 11:26:06 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
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 ]

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/all/20241008092606.GJ33184@noisy.programming.kicks-ass.net

---
 kernel/locking/rtmutex_api.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
index a6974d0..7e79258 100644
--- a/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -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);
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-24 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-08  9:26 [PATCH] locking/rtmutex: Fix misleading comment Peter Zijlstra
2024-10-08 10:50 ` Sebastian Andrzej Siewior
2024-10-24 21:07 ` [tip: locking/core] " tip-bot2 for Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®