[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210526091057.1800-1-song.bao.hua@hisilicon.com>
Date: Wed, 26 May 2021 21:10:57 +1200
From: Barry Song <song.bao.hua@...ilicon.com>
To: <vincent.guittot@...aro.org>, <mingo@...hat.com>,
<peterz@...radead.org>, <dietmar.eggemann@....com>,
<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>
CC: <valentin.schneider@....com>, <juri.lelli@...hat.com>,
<bristot@...hat.com>, <linux-kernel@...r.kernel.org>,
<guodong.xu@...aro.org>, <yangyicong@...wei.com>,
<tangchengchang@...wei.com>, <linuxarm@...wei.com>,
Barry Song <song.bao.hua@...ilicon.com>
Subject: [PATCH] sched: fair: don't depend on wake_wide if waker and wakee are already in same LLC
when waker and wakee are already in the same LLC, it is pointless to worry
about the competition caused by pulling wakee to waker's LLC domain.
Signed-off-by: Barry Song <song.bao.hua@...ilicon.com>
---
kernel/sched/fair.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3248e24a90b0..cfb1bd47acc3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6795,7 +6795,15 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
new_cpu = prev_cpu;
}
- want_affine = !wake_wide(p) && cpumask_test_cpu(cpu, p->cpus_ptr);
+ /*
+ * we use wake_wide to make smarter pull and avoid cruel
+ * competition because of jam-packed tasks in waker's LLC
+ * domain. But if waker and wakee have been already in
+ * same LLC domain, it seems it is pointless to depend
+ * on wake_wide
+ */
+ want_affine = (cpus_share_cache(cpu, prev_cpu) || !wake_wide(p)) &&
+ cpumask_test_cpu(cpu, p->cpus_ptr);
}
rcu_read_lock();
--
2.25.1
Powered by blists - more mailing lists