public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: prefer available idle cpu in select_idle_core
@ 2024-06-12 11:54 zhangwei123171
  2024-06-13  4:40 ` K Prateek Nayak
  2024-06-20  8:16 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: zhangwei123171 @ 2024-06-12 11:54 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt
  Cc: linux-kernel, zhangwei123171

From: zhangwei123171 <zhangwei123171@jd.com>

When the idle core cannot be found, the first sched idle cpu
or first available idle cpu will be used if exsit.

We can use the available idle cpu detected later to ensure it
can be used if exsit.

Signed-off-by: zhangwei123171 <zhangwei123171@jd.com>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 41b58387023d..653ca3ea09b6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7341,7 +7341,7 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu
 			}
 			break;
 		}
-		if (*idle_cpu == -1 && cpumask_test_cpu(cpu, cpus))
+		if (cpumask_test_cpu(cpu, cpus))
 			*idle_cpu = cpu;
 	}
 
-- 
2.33.0


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

end of thread, other threads:[~2024-06-20  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-12 11:54 [PATCH] sched/fair: prefer available idle cpu in select_idle_core zhangwei123171
2024-06-13  4:40 ` K Prateek Nayak
2024-06-20  8:16 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox