未验证 提交 81e6845b 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!238 sched/fair: Avoid offline tasks starve to death for priority load balance

Merge Pull Request from: @zhangsong234 
 
When priority load balance enabled for online/offline tasks co-location,
offline tasks maybe starve to death by load balance detach_tasks() if env->loop
exceed env->loop_max and can not be migrate to idle cpus.

So we should set env->loop to 0 and detach offline tasks again.

Fixes: fbfd4454 ("sched: Introduce priority load balance for CFS")

issue reflink:
https://gitee.com/openeuler/kernel/issues/I60S5R?from=project-issue 
 
Link:https://gitee.com/openeuler/kernel/pulls/238 
Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
......@@ -8707,6 +8707,13 @@ static int detach_tasks(struct lb_env *env)
#ifdef CONFIG_SCHED_PRIO_LB
if (sysctl_sched_prio_load_balance_enabled && env->imbalance > 0) {
/*
* Avoid offline tasks starve to death if env->loop exceed
* env->loop_max, so we should set env->loop to 0 and detach
* offline tasks again.
*/
if (env->loop > env->loop_max)
env->loop = 0;
loop++;
if (loop == 1) {
tasks = &env->src_rq->cfs_offline_tasks;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册