From: zhangwei123171 zhangwei123171@jd.com
jingdong inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8F9FB
--------------------------------
In a co-location scenario, when an online container uses the dynamic affinity capability, the CPU that is full of offline tasks will also be used as an idle CPU, which is more friendly to online tasks.
Fixes: 2a3bb3c0af29 ("sched: Adjust wakeup cpu range according CPU util dynamicly") Signed-off-by: zhangwei123171 zhangwei123171@jd.com Signed-off-by: Hui Tang tanghui20@huawei.com --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6361abb4c302..2c2fdb792385 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8060,7 +8060,7 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, if (unlikely(!tg->se[cpu])) continue;
- if (idlest_cpu && available_idle_cpu(cpu)) { + if (idlest_cpu && (available_idle_cpu(cpu) || sched_idle_cpu(cpu))) { *idlest_cpu = cpu; } else if (idlest_cpu) { spare = (long)(capacity_of(cpu) - tg->se[cpu]->avg.util_avg); @@ -8070,7 +8070,7 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, } }
- if (available_idle_cpu(cpu)) { + if (available_idle_cpu(cpu) || sched_idle_cpu(cpu)) { rcu_read_unlock(); p->select_cpus = p->prefer_cpus; if (sd_flag & SD_BALANCE_WAKE)