[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211015092641.2266cf59@gandalf.local.home>
Date: Fri, 15 Oct 2021 09:26:41 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Barry Song <21cnbao@...il.com>
Cc: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
bsegall@...gle.com, mgorman@...e.de, bristot@...hat.com,
linux-kernel@...r.kernel.org, linuxarm@...wei.com,
yangyicong@...ilicon.com, Barry Song <song.bao.hua@...ilicon.com>
Subject: Re: [PATCH] sched/fair: document the slow path and fast path in
select_task_rq_fair
On Fri, 15 Oct 2021 12:14:12 +0800
Barry Song <21cnbao@...il.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 */
Powered by blists - more mailing lists