[Devel] [PATCH RHEL7 COMMIT] sched: Fix cfs_rq->active assignment in sched_cfs_active_timer()

Konstantin Khorenko khorenko at virtuozzo.com
Thu Sep 8 03:10:34 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.28.2.vz7.17.4
------>
commit 2b655a517e936eb505360756204daf60de2f3e00
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Thu Sep 8 14:10:34 2016 +0400

    sched: Fix cfs_rq->active assignment in sched_cfs_active_timer()
    
    sched_cfs_active_timer() is used to postpone decrementing of
    tg->nr_cpus_active and marking cfs_rq as inactive. It's need
    to give a possibility for a new tg task to stand on a hot cpu,
    where another tg's task gone to sleep a moment ago.
    
    See for dec_nr_active_cfs_rqs(), which postpone actions it does.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabinin 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 a419f39..6d03ebf 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -510,7 +510,7 @@ static enum hrtimer_restart sched_cfs_active_timer(struct hrtimer *timer)
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&rq->lock, flags);
-	cfs_rq->active = !!list_empty(&cfs_rq->tasks);
+	cfs_rq->active = !list_empty(&cfs_rq->tasks);
 	raw_spin_unlock_irqrestore(&rq->lock, flags);
 
 	atomic_dec(&cfs_rq->tg->nr_cpus_active);


More information about the Devel mailing list