[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211124085401.14411-1-yangyicong@hisilicon.com>
Date: Wed, 24 Nov 2021 16:54:01 +0800
From: Yicong Yang <yangyicong@...ilicon.com>
To: <mingo@...hat.com>, <peterz@...radead.org>,
<juri.lelli@...hat.com>, <vincent.guittot@...aro.org>,
<mgorman@...e.de>, <linux-kernel@...r.kernel.org>
CC: <dietmar.eggemann@....com>, <rostedt@...dmis.org>,
<bsegall@...gle.com>, <bristot@...hat.com>,
<song.bao.hua@...ilicon.com>, <prime.zeng@...wei.com>,
<yangyicong@...ilicon.com>, <linuxarm@...wei.com>,
<21cnbao@...il.com>
Subject: [PATCH] sched/fair: Clear target from cpus to scan in select_idle_cpu
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@...ilicon.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
Powered by blists - more mailing lists