mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Barry Song <21cnbao@gmail.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	linux-kernel@vger.kernel.org, linuxarm@huawei.com,
	yangyicong@hisilicon.com, Barry Song <song.bao.hua@hisilicon.com>
Subject: Re: [PATCH] sched/fair: document the slow path and fast path in select_task_rq_fair
Date: Fri, 15 Oct 2021 09:26:41 -0400	[thread overview]
Message-ID: <20211015092641.2266cf59@gandalf.local.home> (raw)
In-Reply-To: <20211015041412.5569-1-21cnbao@gmail.com>

On Fri, 15 Oct 2021 12:14:12 +0800
Barry Song <21cnbao@gmail.com> wrote:

> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6951,6 +6951,11 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
>  			break;
>  		}
>  
> +		/*
> +		 * This is usually true only for WF_EXEC and WF_FORK, for WF_TTWU
> +		 * it is almost always false as sched_domain hasn't SD_BALANCE_WAKE
> +		 * in default

Comments are fine, but the above needs some grammar work.

		/*
		 * Usually only true for WF_EXEC and WF_FORK, as
		 * sched_domains usually do not have SD_BALANCE_WAKE set.
		 */

?

> +		 */
>  		if (tmp->flags & sd_flag)
>  			sd = tmp;
>  		else if (!want_affine)
> @@ -6958,7 +6963,11 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
>  	}
>  
>  	if (unlikely(sd)) {
> -		/* Slow path */
> +		/*
> +		 * Slow path, usually only for WF_EXEC and WF_FORK; WF_TTWU almost
> +		 * always goes to fast path as sched_domain hasn't SD_BALANCE_WAKE
> +		 * in default
> +		 */

As the only way to have sd set, is from the above if statement, I believe
this comment is redundant.

-- Steve


>  		new_cpu = find_idlest_cpu(sd, p, cpu, prev_cpu, sd_flag);
>  	} else if (wake_flags & WF_TTWU) { /* XXX always ? */
>  		/* Fast path */

      reply	other threads:[~2021-10-15 13:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  4:14 Barry Song
2021-10-15 13:26 ` Steven Rostedt [this message]

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=20211015092641.2266cf59@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=21cnbao@gmail.com \
    --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=linuxarm@huawei.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=song.bao.hua@hisilicon.com \
    --cc=vincent.guittot@linaro.org \
    --cc=yangyicong@hisilicon.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

all inboxes | Powered by JetHome®