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

Kirill Tkhai ktkhai at virtuozzo.com
Wed Sep 7 02:53:40 PDT 2016


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>
---
 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 515685f..34eb09d 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