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

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 14 09:14:31 PDT 2017


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


More information about the Devel mailing list