From: Yury Norov <yury.norov@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>,
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: [PATCH 2/2] sched/topology: optimize topology_span_sane()
Date: Fri, 2 Aug 2024 10:57:43 -0700 [thread overview]
Message-ID: <20240802175750.1152788-3-yury.norov@gmail.com> (raw)
In-Reply-To: <20240802175750.1152788-1-yury.norov@gmail.com>
The function may call cpumask_equal with tl->mask(cpu) == tl->mask(i),
even when cpu != i. In such case, cpumask_equal() would always return
true, and we can proceed to the next iteration immediately.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
kernel/sched/topology.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 754ad5fa3c99..571759606954 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -2368,6 +2368,8 @@ static bool topology_span_sane(struct sched_domain_topology_level *tl,
*/
for_each_cpu_from(i, cpu_map) {
mi = tl->mask(i);
+ if (mi == mc)
+ continue;
/*
* We should 'and' all those masks with 'cpu_map' to exactly
--
2.43.0
next prev parent reply other threads:[~2024-08-02 17:58 UTC|newest]
Thread overview: 10+ 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
2024-08-02 17:57 ` Yury Norov [this message]
2024-08-06 15:50 ` [PATCH 2/2] sched/topology: optimize topology_span_sane() 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 2/2] " Yury Norov
[not found] <20240319185148.985729-1-kyle.meyer@hpe.com>
[not found] ` <20240319185148.985729-3-kyle.meyer@hpe.com>
2024-03-20 18:32 ` [PATCH 2/2] sched/topology: Optimize topology_span_sane() 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=20240802175750.1152788-3-yury.norov@gmail.com \
--to=yury.norov@gmail.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 \
/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.