The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] sched/fair: add !se->on_rq check before dequeue entity
@ 2020-02-20  7:29 qiwuchen55
  2020-02-20  9:38 ` Vincent Guittot
  0 siblings, 1 reply; 6+ messages in thread
From: qiwuchen55 @ 2020-02-20  7:29 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman
  Cc: linux-kernel, chenqiwu

From: chenqiwu <chenqiwu@xiaomi.com>

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@xiaomi.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-20 14:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-20  7:29 [PATCH] sched/fair: add !se->on_rq check before dequeue entity qiwuchen55
2020-02-20  9:38 ` Vincent Guittot
2020-02-20 10:09   ` chenqiwu
2020-02-20 10:31     ` Vincent Guittot
2020-02-20 12:15       ` Vincent Guittot
2020-02-20 14:42         ` chenqiwu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox