sched/fair: Correct CPU selection from isolated domain
PATCH 1/1 sched/fair: Correct CPU selection from isolated domain
We encountered an issue where the kernel thread ksmd runs on the PMD dedicated isolated core, leading to high latency in OVS packets.
Upon analysis, we discovered that this is caused by the current select_idle_smt() function not taking the sched_domain mask into account.
Kernel version: linux-4.19.y
Signed-off-by wujing <[email protected]>
Signed-off-by QiLiang Yuan <[email protected]>
--- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/fair.c +2 -1
@@ -6171,7 +6171,8 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int treturn -1 ;for_each_cpu (cpu,cpu_smt_mask (target)) { -if (!cpumask_test_cpu (cpu, &p->cpus_allowed)) +if (!cpumask_test_cpu (cpu, &p->cpus_allowed) || + !cpumask_test_cpu (cpu,sched_domain_span (sd)))continue ;if (available_idle_cpu (cpu))return cpu;
Signature · 1 line
2.45.2