[Devel] [PATCH] sched/fair: Fix ENQUEUE_WAKEUP false appearance in enqueue_task_fair()

Kirill Tkhai ktkhai at virtuozzo.com
Thu Apr 13 09:01:20 PDT 2017


When enqueue_task_fair() is called without ENQUEUE_WAKEUP,
e.g. on priority changing or on migration, we forced add it,
that is wrong, because this leads to incorrect accounting
of vruntime of parent cfs_rq's. I think (and the sane vision
confims this), the initial aim was to clear ENQUEUE_BOOST bit
before next iteration, but it was made incorrect.

Fix that by doing this apparently, instead of corrupting
parent's vruntime.

Found in scope of https://jira.sw.ru/browse/PSBM-62208

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4fde0d42a95..a8cf67c977b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4289,7 +4289,7 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
 		if (boost)
 			boost = enqueue_boosted_entity(cfs_rq, se);
 
-		flags = ENQUEUE_WAKEUP;
+		flags &= ~ENQUEUE_BOOST;
 	}
 
 	for_each_sched_entity(se) {



More information about the Devel mailing list