public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Correct CPU selection from isolated domain
@ 2024-07-30  7:10 wujing
  2024-07-30  8:22 ` Peter Zijlstra
  2024-07-30  9:02 ` zhengzucheng
  0 siblings, 2 replies; 12+ messages in thread
From: wujing @ 2024-07-30  7:10 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel, dongml2, wujing, QiLiang Yuan

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 <realwujing@qq.com>
Signed-off-by: QiLiang Yuan <yuanql9@chinatelecom.cn>
---
 kernel/sched/fair.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 09f82c84474b..0950cabfc1d0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6171,7 +6171,8 @@ static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int t
 		return -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;
-- 
2.45.2


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

end of thread, other threads:[~2024-07-30 10:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30  7:10 [PATCH] sched/fair: Correct CPU selection from isolated domain wujing
2024-07-30  8:22 ` Peter Zijlstra
2024-07-30  9:03   ` wujing
2024-07-30  9:11     ` Greg KH
2024-07-30  9:25       ` wujing
2024-07-30  9:30       ` wujing
2024-07-30  9:41         ` Greg KH
2024-07-30  9:40       ` wujing
2024-07-30  9:51         ` Greg KH
2024-07-30 10:11           ` wujing
2024-07-30 10:20             ` Greg KH
2024-07-30  9:02 ` zhengzucheng

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