[RESEND RFC PATCH v2 08/29] sched/fair: Use for_each_cpu_and_wrap() in select_idle_cpu()

K Prateek Nayak posted 29 patches 1 week, 4 days ago
Only 28 patches received!
[RESEND RFC PATCH v2 08/29] sched/fair: Use for_each_cpu_and_wrap() in select_idle_cpu()
Posted by K Prateek Nayak 1 week, 4 days ago
Avoid the "cpumask_test() + continue" pattern for cluster cpumask
traversal in select_idle_cpu().

No functional changes intended.

Cc: Yury Norov <yury.norov@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
 kernel/sched/fair.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5abe0ccecef3..8f5745495974 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7652,10 +7652,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool
 		struct sched_group *sg = sd->groups;
 
 		if (sg->flags & SD_CLUSTER) {
-			for_each_cpu_wrap(cpu, sched_group_span(sg), target + 1) {
-				if (!cpumask_test_cpu(cpu, cpus))
-					continue;
-
+			for_each_cpu_and_wrap(cpu, sched_group_span(sg), cpus, target + 1) {
 				if (has_idle_core) {
 					i = select_idle_core(p, cpu, cpus, &idle_cpu);
 					if ((unsigned int)i < nr_cpumask_bits)
-- 
2.43.0