If we enable the STEAL feature, when the newidle_balance fails, it will first find the busy CPU from the same smt, and then the same LLC.
This patch makes the following modifications: the same cluster will be scanned before LLC. Thus, we can use more memory bandwidth.
Signed-off-by: Cheng Yu serein.chengyu@huawei.com --- kernel/sched/fair.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 95d1841f8a20..2cc30fa158e5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -13164,6 +13164,19 @@ static int try_steal(struct rq *dst_rq, struct rq_flags *dst_rf) } #endif /* CONFIG_SCHED_SMT */
+#ifdef CONFIG_SCHED_CLUSTER + /* + * Then try overloaded CPUs on the same cluster to preserve cache warmth further. + */ + for_each_cpu(src_cpu, cpu_clustergroup_mask(dst_cpu)) { + if (sparsemask_test_elem(overload_cpus, src_cpu) && + steal_from(dst_rq, dst_rf, &locked, src_cpu)) { + stolen = 1; + goto out; + } + } +#endif /* CONFIG_SCHED_CLUSTER */ + /* Accept any suitable task in the LLC */
sparsemask_for_each(overload_cpus, dst_cpu, src_cpu) {
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/10800 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/T...
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/10800 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/T...