public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Clear target from cpus to scan in select_idle_cpu
@ 2021-11-24  8:54 Yicong Yang
  2021-11-25 11:17 ` Mel Gorman
  0 siblings, 1 reply; 4+ messages in thread
From: Yicong Yang @ 2021-11-24  8:54 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, mgorman, linux-kernel
  Cc: dietmar.eggemann, rostedt, bsegall, bristot, song.bao.hua,
	prime.zeng, yangyicong, linuxarm, 21cnbao

Commit 56498cfb045d noticed that "When select_idle_cpu starts scanning for
an idle CPU, it starts with a target CPU that has already been checked
by select_idle_sibling. This patch starts with the next CPU instead."
It only changed the scanning start cpu to target + 1 but still leave
the target in the scanning cpumask. The target still have a chance to be
checked in the last turn. Fix this by clear the target from the cpus
to scan.

Fixes: 56498cfb045d ("sched/fair: Avoid a second scan of target in select_idle_cpu")
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 kernel/sched/fair.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6e476f6d9435..e1031e0da231 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6249,6 +6249,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool
 		return -1;
 
 	cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
+	cpumask_clear_cpu(target, cpus);
 
 	if (sched_feat(SIS_PROP) && !has_idle_core) {
 		u64 avg_cost, avg_idle, span_avg;
-- 
2.33.0


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

end of thread, other threads:[~2021-11-26  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-24  8:54 [PATCH] sched/fair: Clear target from cpus to scan in select_idle_cpu Yicong Yang
2021-11-25 11:17 ` Mel Gorman
2021-11-25 12:46   ` Yicong Yang
2021-11-26  9:38     ` Yicong Yang

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