[PATCH OLK-5.10 V1] sched/fair: Fix the bug in dynamic smt when getting physical core load

hulk inclusion category: bugfix 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". Fixes: 5ea39a25cc45 ("sched/fair: Optimize the dynamic smt") Signed-off-by: Cheng Yu <serein.chengyu@huawei.com> --- kernel/sched/fair.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5fc8d6a25b9a..5a191054d73f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7333,9 +7333,8 @@ int sysctl_sched_util_ratio = 100; 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 capacity = rq->cpu_capacity; + unsigned long util = cpu_util(core_id); + unsigned long capacity = capacity_of(core_id); if (sysctl_sched_util_ratio == 100) return true; -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/16299 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/FR6... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/16299 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/FR6...
participants (2)
-
Cheng Yu
-
patchwork bot