Re: [PATCH] sched/deadline: remove dl_new checking condition from dl_task_timer()

From: Juri Lelli
Date: Tue Apr 29 2014 - 04:40:06 EST


Hi,

On Mon, 28 Apr 2014 11:57:25 +0900
"yjay.kim" <yjay.kim@xxxxxxx> wrote:

> From: "yjay.kim" <yjay.kim@xxxxxxx>
>
> yield_task_dl() sets dl.dl_new as 1 and dequeue current dl task.
> After that it expects that next bandwidth timer callback `dl_task_timer()` will
> replenish budget of dl task and enqueue it again.
>
> But current dl_task_timer() does nothing in case dl.dl_new is 1.
> So when dl task calls sched_yield(), it will never be scheduled again.
>
> dl_task_timer() should works in case dl_new is 1.
>
> Signed-off-by: yjay.kim <yjay.kim@xxxxxxx>
> ---
> kernel/sched/deadline.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 27ef409..6fb4004 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -522,7 +522,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer)
> * different from SCHED_DEADLINE or changed its reservation
> * parameters (through sched_setscheduler()).
> */
> - if (!dl_task(p) || dl_se->dl_new)

Unfortunately, we still need this check to discriminate cases when the
user wanted to change reservation parameters while the task was
throttled; and we don't want to do anything in this case.

> + if (!dl_task(p))
> goto unlock;
>
> sched_clock_tick();

I'd propose something like the following instead.

Thanks,

- Juri