[PATCH] sched/fair: add !se->on_rq check before dequeue entity
From: qiwuchen55
Date: Thu Feb 20 2020 - 02:29:56 EST
From: chenqiwu <chenqiwu@xxxxxxxxxx>
We igonre checking for !se->on_rq condition before dequeue one
entity from cfs rq. It must be required in case the entity has
been dequeued.
Signed-off-by: chenqiwu <chenqiwu@xxxxxxxxxx>
---
kernel/sched/fair.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3c8a379..945dcaf 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5341,6 +5341,8 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
bool was_sched_idle = sched_idle_rq(rq);
for_each_sched_entity(se) {
+ if (!se->on_rq)
+ break;
cfs_rq = cfs_rq_of(se);
dequeue_entity(cfs_rq, se, flags);
--
1.9.1