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

Andrey Ryabinin aryabinin at virtuozzo.com
Thu Sep 8 02:14:31 PDT 2016



On 09/07/2016 12:53 PM, Kirill Tkhai wrote:
> 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 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);
> 
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://lists.openvz.org/mailman/listinfo/devel
> 


More information about the Devel mailing list