Messages in this thread Patch in this message | | | From | Yury Norov <> | Subject | [PATCH 20/22] sched/topology: replace cpumask_weight() with cpumask_weight_eq() where appropriate | Date | Tue, 10 May 2022 08:47:48 -0700 |
| |
Replace cpumask_weight() with cpumask_weight_eq(..., 1) because it may return earlier.
CC: Ben Segall <bsegall@google.com> CC: Daniel Bristot de Oliveira <bristot@redhat.com> CC: Dietmar Eggemann <dietmar.eggemann@arm.com> CC: Ingo Molnar <mingo@redhat.com> CC: Juri Lelli <juri.lelli@redhat.com> CC: Mel Gorman <mgorman@suse.de> CC: Peter Zijlstra <peterz@infradead.org> CC: Steven Rostedt <rostedt@goodmis.org> CC: Valentin Schneider <vschneid@redhat.com> CC: Vincent Guittot <vincent.guittot@linaro.org> CC: linux-kernel@vger.kernel.org Signed-off-by: Yury Norov <yury.norov@gmail.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
| |