From 33d20ffcd8de789a90ca2548a364db84aad4d2a4 Mon Sep 17 00:00:00 2001 From: Cheng Yu Date: Sun, 27 Apr 2025 17:30:49 +0800 Subject: [PATCH] sched/fair: Fix the bug in dynamic smt when getting physical core load hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IC4CNP CVE: NA -------------------------------- Fix a bug in the dynamic smt feature. Specifically, when determining whether a physical core has idle capacity, there is a bug in obtaining the load of the core. We should use "core_id" instead of "cpu". Signed-off-by: Cheng Yu --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5fc8d6a25b9a..e9e4765b0d6e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7334,7 +7334,7 @@ static bool core_has_spare(int cpu) { int core_id = cpumask_first(cpu_smt_mask(cpu)); struct rq *rq = cpu_rq(core_id); - unsigned long util = cpu_util(cpu); + unsigned long util = cpu_util(core_id); unsigned long capacity = rq->cpu_capacity; if (sysctl_sched_util_ratio == 100) -- Gitee