From: Chen Yu <yu.c.chen@intel.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: <linux-kernel@vger.kernel.org>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Leonardo Bras <leobras@redhat.com>,
"Ingo Molnar" <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>
Subject: Re: [PATCH 1/2] sched/topology: pre-compute topology_span_sane() loop params
Date: Sat, 3 Aug 2024 23:32:39 +0800 [thread overview]
Message-ID: <Zq5Nl5gBuT5Y8S8N@chenyu5-mobl2> (raw)
In-Reply-To: <20240802175750.1152788-2-yury.norov@gmail.com>
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@wanadoo.fr>
> Suggested-by: Leonardo Bras <leobras@redhat.com>
> Signed-off-by: Yury Norov <yury.norov@gmail.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@intel.com>
thanks,
Chenyu
next prev parent reply other threads:[~2024-08-03 15:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 17:57 [PATCH 0/2] sched/topology: optimize topology_span_sane() Yury Norov
2024-08-02 17:57 ` [PATCH 1/2] sched/topology: pre-compute topology_span_sane() loop params Yury Norov
2024-08-03 15:32 ` Chen Yu [this message]
2024-08-02 17:57 ` [PATCH 2/2] sched/topology: optimize topology_span_sane() Yury Norov
2024-08-06 15:50 ` Valentin Schneider
2024-08-06 18:00 ` Yury Norov
2024-08-07 13:53 ` Valentin Schneider
2024-08-07 16:39 ` Yury Norov
-- strict thread matches above, loose matches on Subject: below --
2024-08-07 19:05 [PATCH v2 0/2] " Yury Norov
2024-08-07 19:05 ` [PATCH 1/2] sched/topology: pre-compute topology_span_sane() loop params Yury Norov
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=Zq5Nl5gBuT5Y8S8N@chenyu5-mobl2 \
--to=yu.c.chen@intel.com \
--cc=bsegall@google.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=leobras@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=yury.norov@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.