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

Submitted by Konstantin Khorenko on April 14, 2017, 4:14 p.m.

Details

Message ID 201704141614.v3EGEV7E021380@finist_cl7.x64_64.work.ct
State New
Series "sched/fair: Fix ENQUEUE_WAKEUP false appearance in enqueue_task_fair()"
Headers show

Commit Message

Konstantin Khorenko April 14, 2017, 4:14 p.m.
The commit is pushed to "branch-rh7-3.10.0-514.10.2.vz7.29.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.10.2.vz7.29.16
------>
commit 4b80b645846322b204e7dd80f1017594ce38b9fb
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Apr 14 20:14:31 2017 +0400

    sched/fair: Fix ENQUEUE_WAKEUP false appearance in enqueue_task_fair()
    
    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 4fde0d4..a8cf67c 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) {