提交 2af15a46 编写于 作者: H Hui Tang 提交者: Yongqiang Liu

sched: Adjust cpu range in load balance dynamicly

hulk inclusion
category: feature
bugzilla: 187173, https://gitee.com/openeuler/kernel/issues/I5G4IH
CVE: NA

--------------------------------
Signed-off-by: NHui Tang <tanghui20@huawei.com>
Reviewed-by: NChen Hui <judy.chenhui@huawei.com>
Reviewed-by: NZhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 70a232a5
......@@ -7789,7 +7789,12 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu))
return 0;
#ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY
set_task_select_cpus(p, NULL, 0);
if (!cpumask_test_cpu(env->dst_cpu, p->select_cpus)) {
#else
if (!cpumask_test_cpu(env->dst_cpu, &p->cpus_allowed)) {
#endif
int cpu;
schedstat_inc(p->se.statistics.nr_failed_migrations_affine);
......@@ -7809,7 +7814,11 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
/* Prevent to re-select dst_cpu via env's CPUs: */
for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) {
#ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY
if (cpumask_test_cpu(cpu, p->select_cpus)) {
#else
if (cpumask_test_cpu(cpu, &p->cpus_allowed)) {
#endif
env->flags |= LBF_DST_PINNED;
env->new_dst_cpu = cpu;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册