[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zq5Nl5gBuT5Y8S8N@chenyu5-mobl2>
Date: Sat, 3 Aug 2024 23:32:39 +0800
From: Chen Yu <yu.c.chen@...el.com>
To: Yury Norov <yury.norov@...il.com>
CC: <linux-kernel@...r.kernel.org>, Christophe JAILLET
<christophe.jaillet@...adoo.fr>, Leonardo Bras <leobras@...hat.com>, "Ingo
Molnar" <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>, Juri Lelli
<juri.lelli@...hat.com>, Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>, Steven Rostedt
<rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel Gorman
<mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>
Subject: Re: [PATCH 1/2] sched/topology: pre-compute topology_span_sane()
loop params
On 2024-08-02 at 10:57:42 -0700, Yury Norov wrote:
> tl->mask(cpu) is used unchanged in the loop, and tl->mask(i) in worst
> case may be calculated twice as parameters for cpumask_equal() and
> cpumask_intersects(). So, precalculate both.
>
> Suggested-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> Suggested-by: Leonardo Bras <leobras@...hat.com>
> Signed-off-by: Yury Norov <yury.norov@...il.com>
> ---
> kernel/sched/topology.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 76504b776d03..754ad5fa3c99 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -2353,6 +2353,7 @@ static struct sched_domain *build_sched_domain(struct sched_domain_topology_leve
> static bool topology_span_sane(struct sched_domain_topology_level *tl,
> const struct cpumask *cpu_map, int cpu)
> {
> + const struct cpumask *mi, *mc = tl->mask(cpu);
Could it avoid the calculation by putting
mc = tl->mask(cpu) after the
if (tl->flags & SDTL_OVERLAP)?
Other than that,
Reviewed-by: Chen Yu <yu.c.chen@...el.com>
thanks,
Chenyu
Powered by blists - more mailing lists