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

Submitted by Kirill Tkhai on April 13, 2017, 4:01 p.m.

Details

Message ID 149209923127.10512.4570634798607295688.stgit@localhost.localdomain
State New
Series "sched/fair: Fix ENQUEUE_WAKEUP false appearance in enqueue_task_fair()"
Headers show

Commit Message

Kirill Tkhai April 13, 2017, 4:01 p.m.
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@virtuozzo.com>
---
 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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) {