public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Zhang Qiao <zhangqiao22@huawei.com>,
	mingo@redhat.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com, vschneid@redhat.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH] sched/core: Update stale comment in try_to_wake_up()
Date: Wed, 4 Oct 2023 11:39:53 +0200	[thread overview]
Message-ID: <ZR0y6RJFnOrG2/Nw@gmail.com> (raw)
In-Reply-To: <20231004093323.GK1539@noisy.programming.kicks-ass.net>


* Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, Oct 04, 2023 at 11:31:26AM +0200, Ingo Molnar wrote:
> > 
> > * Zhang Qiao <zhangqiao22@huawei.com> wrote:
> > 
> > > Since commit 9b3c4ab3045e ("sched,rcu: Rework
> > > try_invoke_on_locked_down_task()") renamed
> > > try_invoke_on_locked_down_task() to task_call_func().
> > > Now, update some comment about it.
> > > 
> > > Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com>
> > > ---
> > >  kernel/sched/core.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > > index 0d18c3969f90..540ac33ddb80 100644
> > > --- a/kernel/sched/core.c
> > > +++ b/kernel/sched/core.c
> > > @@ -4186,7 +4186,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
> > >  	 * Pairs with the LOCK+smp_mb__after_spinlock() on rq->lock in
> > >  	 * __schedule().  See the comment for smp_mb__after_spinlock().
> > >  	 *
> > > -	 * A similar smb_rmb() lives in try_invoke_on_locked_down_task().
> > > +	 * A similar smb_rmb() lives in task_call_func().
> > 
> > Except the matching smp_rmb() doesn't live in task_call_func() anymore, so 
> > you now turned a stale comment into a misleading one ...
> 
> It moved, *again*, it's now in __task_needs_rq_lock() :-)

Yeah, I know, see:

   bdf85bec2b1e ("sched/core: Update stale comment in try_to_wake_up()")

Thanks,

	Ingo

====================>
From: Ingo Molnar <mingo@kernel.org>
Date: Wed, 4 Oct 2023 11:33:36 +0200
Subject: [PATCH] sched/core: Update stale comment in try_to_wake_up()

The following commit:

  9b3c4ab3045e ("sched,rcu: Rework try_invoke_on_locked_down_task()")

... renamed try_invoke_on_locked_down_task() to task_call_func(),
but forgot to update the comment in try_to_wake_up().

But it turns out that the smp_rmb() doesn't live in task_call_func()
either, it was moved to __task_needs_rq_lock() in:

  91dabf33ae5d ("sched: Fix race in task_call_func()")

Fix that now.

Also fix the s/smb/smp typo while at it.

Reported-by: Zhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230731085759.11443-1-zhangqiao22@huawei.com
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 65e10ac34660..f5783cb16791 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4237,7 +4237,7 @@ int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 		 * Pairs with the LOCK+smp_mb__after_spinlock() on rq->lock in
 		 * __schedule().  See the comment for smp_mb__after_spinlock().
 		 *
-		 * A similar smb_rmb() lives in try_invoke_on_locked_down_task().
+		 * A similar smp_rmb() lives in __task_needs_rq_lock().
 		 */
 		smp_rmb();
 		if (READ_ONCE(p->on_rq) && ttwu_runnable(p, wake_flags))


  reply	other threads:[~2023-10-04  9:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  8:57 [PATCH] sched: Update comment of try_invoke_on_locked_down_task() Zhang Qiao
2023-10-04  9:31 ` Ingo Molnar
2023-10-04  9:33   ` Peter Zijlstra
2023-10-04  9:39     ` Ingo Molnar [this message]
2023-10-04  9:42 ` [tip: sched/core] sched/core: Update stale comment in try_to_wake_up() tip-bot2 for Ingo Molnar
2023-10-07 17:11 ` tip-bot2 for Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZR0y6RJFnOrG2/Nw@gmail.com \
    --to=mingo@kernel.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=zhangqiao22@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox