[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220510154750.212913-21-yury.norov@gmail.com>
Date: Tue, 10 May 2022 08:47:48 -0700
From: Yury Norov <yury.norov@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
David Laight <David.Laight@...LAB.COM>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Joe Perches <joe@...ches.com>,
Julia Lawall <Julia.Lawall@...ia.fr>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Nicholas Piggin <npiggin@...il.com>,
Nicolas Palix <nicolas.palix@...g.fr>,
Peter Zijlstra <peterz@...radead.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>, Ben Segall <bsegall@...gle.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Mel Gorman <mgorman@...e.de>,
Steven Rostedt <rostedt@...dmis.org>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>
Subject: [PATCH 20/22] sched/topology: replace cpumask_weight() with cpumask_weight_eq() where appropriate
Replace cpumask_weight() with cpumask_weight_eq(..., 1) because it
may return earlier.
CC: Ben Segall <bsegall@...gle.com>
CC: Daniel Bristot de Oliveira <bristot@...hat.com>
CC: Dietmar Eggemann <dietmar.eggemann@....com>
CC: Ingo Molnar <mingo@...hat.com>
CC: Juri Lelli <juri.lelli@...hat.com>
CC: Mel Gorman <mgorman@...e.de>
CC: Peter Zijlstra <peterz@...radead.org>
CC: Steven Rostedt <rostedt@...dmis.org>
CC: Valentin Schneider <vschneid@...hat.com>
CC: Vincent Guittot <vincent.guittot@...aro.org>
CC: linux-kernel@...r.kernel.org
Signed-off-by: Yury Norov <yury.norov@...il.com>
---
kernel/sched/topology.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 05b6c2ad90b9..860137913b18 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -168,7 +168,7 @@ static const unsigned int SD_DEGENERATE_GROUPS_MASK =
static int sd_degenerate(struct sched_domain *sd)
{
- if (cpumask_weight(sched_domain_span(sd)) == 1)
+ if (cpumask_weight_eq(sched_domain_span(sd), 1))
return 1;
/* Following flags need at least 2 groups */
@@ -1999,7 +1999,7 @@ void sched_update_numa(int cpu, bool online)
* Scheduler NUMA topology is updated when the first CPU of a
* node is onlined or the last CPU of a node is offlined.
*/
- if (cpumask_weight(cpumask_of_node(node)) != 1)
+ if (!cpumask_weight_eq(cpumask_of_node(node), 1))
return;
sched_reset_numa();
--
2.32.0
Powered by blists - more mailing lists