mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] sched/topology: remove redundant cpumask_and in init_overlap_sched_group
@ 2021-03-25  2:31 Barry Song
  2021-03-25 11:08 ` [tip: sched/core] sched/topology: Remove redundant cpumask_and() in init_overlap_sched_group() tip-bot2 for Barry Song
  0 siblings, 1 reply; 2+ messages in thread
From: Barry Song @ 2021-03-25  2:31 UTC (permalink / raw)
  To: vincent.guittot, mingo, peterz, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, mgorman
  Cc: valentin.schneider, linux-kernel, linuxarm, Barry Song,
	Valentin Schneider

mask is built in build_balance_mask() by for_each_cpu(i, sg_span), so
it must be a subset of sched_group_span(sg). Though cpumask_first_and
doesn't lead to a wrong result of balance cpu, it is pointless to do
cpumask_and again.

Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Valentin Schneider <Valentin.Schneider@arm.com>
---
 -v2: add reviewed-by of Valentin, thanks!

 kernel/sched/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index f2066d682cd8..d1aec244c027 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -934,7 +934,7 @@ static void init_overlap_sched_group(struct sched_domain *sd,
 	int cpu;
 
 	build_balance_mask(sd, sg, mask);
-	cpu = cpumask_first_and(sched_group_span(sg), mask);
+	cpu = cpumask_first(mask);
 
 	sg->sgc = *per_cpu_ptr(sdd->sgc, cpu);
 	if (atomic_inc_return(&sg->sgc->ref) == 1)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-25 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25  2:31 [PATCH v2] sched/topology: remove redundant cpumask_and in init_overlap_sched_group Barry Song
2021-03-25 11:08 ` [tip: sched/core] sched/topology: Remove redundant cpumask_and() in init_overlap_sched_group() tip-bot2 for Barry Song

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®