[PATCH 2/3] sched/fair: select cookie matched idle CPU

From: Aubrey Li
Date: Fri Nov 01 2019 - 02:28:09 EST


In the fast path of task wakeup, select the first cookie matched idle
CPU instead of the first idle CPU.

Signed-off-by: Aubrey Li <aubrey.li@xxxxxxxxxxxxxxx>
---
kernel/sched/fair.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ba937b9..19ea8d8 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6074,7 +6074,13 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
if (!cpumask_test_cpu(cpu, p->cpus_ptr))
continue;
if (available_idle_cpu(cpu))
+#ifdef CONFIG_SCHED_CORE
+ if (sched_core_enabled(cpu_rq(cpu)) &&
+ (p->core_cookie == cpu_rq(cpu)->core->core_cookie))
+ break;
+#else
break;
+#endif
}

time = cpu_clock(this) - time;
--
2.7.4

----------------------------------------------------------------------