Commit f32fbd75 authored by Cheng Yu's avatar Cheng Yu
Browse files

sched/fair: Fix the condition in overload_clear

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAWDO4



-----------------------------------------

In the overload_clear function, there is a bug when setting the
overload_cpus, that is, when the steal_task feature is globally enabled
and rq->cfs.h_nr_running is less than 2, the need_clear should be set to
true.

Fixes: 433c0b72 ("sched/fair: Count the number of tasks marked as steal_task on cfs_rq")
Signed-off-by: default avatarCheng Yu <serein.chengyu@huawei.com>
parent 33a5644b
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -4492,11 +4492,10 @@ static void overload_clear(struct rq *rq)
	if (!steal_enabled())
		return;

	if (!group_steal_used() && rq->cfs.h_nr_running >= 2)
		return;
	if (rq->cfs.h_nr_running < 2)
		need_clear = true;

	if (group_steal_used() &&
	    (rq->cfs.h_nr_running < 2 || rq->cfs.steal_h_nr_running == 0))
	if (group_steal_used() && rq->cfs.steal_h_nr_running < 1)
		need_clear = true;

	if (!need_clear)