Re: [patch 06/16] sched: add a timer to handle CFS bandwidth refresh

From: Hidetoshi Seto
Date: Wed Jun 22 2011 - 05:38:58 EST


(2011/06/21 16:16), Paul Turner wrote:
> This patch adds a per-task_group timer which handles the refresh of the global
> CFS bandwidth pool.
>
> Since the RT pool is using a similar timer there's some small refactoring to
> share this support.
>
> Signed-off-by: Paul Turner <pjt@xxxxxxxxxx>
> Reviewed-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
>
> ---
(snip)
> @@ -413,8 +444,26 @@ static void init_cfs_rq_runtime(struct c
> cfs_rq->runtime_enabled = 0;
> }
>
> +/* requires cfs_b->lock */
> +static void __start_cfs_bandwidth(struct cfs_bandwidth *cfs_b)
> +{
> + /*
> + * Handle the extremely unlikely case of trying to start the period
> + * timer, while that timer is in the tear-down path from having
> + * decided to no longer run. In this case we must wait for the
> + * (tail of the) callback to terminate so that we can re-enqueue it.
> + */
> + if (unlikely(hrtimer_active(&cfs_b->period_timer)))
> + hrtimer_cancel(&cfs_b->period_timer);
> +
> + cfs_b->timer_active = 1;
> + start_bandwidth_timer(&cfs_b->period_timer, cfs_b->period);
> +}
> +

Nice trick :-)

(Again,)
Reviewed-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>


Thanks,
H.Seto

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/