
From: zhangwei123171 <zhangwei123171@jd.com> jingdong inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8PGAS ----------------------------------------------------- We have set the preferred CPU, but when the load is too high, the conditions for the preferred CPU are not met. At this time, the idle CPU needs to be reset. This will be corrected in the subsequent fallback process. dynamic affinity should not break this logic. Fixes: 2e1dfc02d115 ("sched: Adjust wakeup cpu range according CPU util dynamicly") Signed-off-by: zhangwei123171 <zhangwei123171@jd.com> Reviewed-by: zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com> Signed-off-by: Cheng Yu <serein.chengyu@huawei.com> --- kernel/sched/fair.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c4c3afa6e7b4..fdb352c870ea 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9179,6 +9179,8 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, p->select_cpus = p->prefer_cpus; if (sd_flag & SD_BALANCE_WAKE) schedstat_inc(p->stats.nr_wakeups_preferred_cpus); + } else if (idlest_cpu) { + *idlest_cpu = -1; } } #endif -- 2.25.1