Re: [PATCH V2] sched/deadline: Update rq_clock of later_rq when pushing a task

From: Steven Rostedt
Date: Wed Aug 01 2018 - 22:46:01 EST


On Mon, 16 Jul 2018 13:45:21 +0300
Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> wrote:

> > --- a/kernel/sched/deadline.c
> > +++ b/kernel/sched/deadline.c
> > @@ -2090,8 +2090,16 @@ static int push_dl_task(struct rq *rq)
> > sub_rq_bw(&next_task->dl, &rq->dl);
> > set_task_cpu(next_task, later_rq->cpu);
> > add_rq_bw(&next_task->dl, &later_rq->dl);
> > +
> > + /*
> > + * Update the later_rq clock here, because the clock is used
> > + * by the cpufreq_update_util() inside __add_running_bw().
> > + * Then, set ENQUEUE_NOCLOCK flag to avoid updating the rq_clock
> > + * again in the activate_task()->enqueue_task().
>
> Is the second sentence really needed? It seems everybody knows, what NOCLOCK
> flag does, and we does not have to paraphrase this in every place it's used :)

I would keep the mention, but change the comment:

/*
* Update the later_rq clock before calling add_running_bw()
* because the clock is used by cpufreq_update_util() that is
* inside __add_running_bw(). As the later_rq clock is already
* updated, we need to set ENQUEUE_NOCLOCK to prevent
* activate_task() from updating it again.
*/
Other than that...

Acked-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>

-- Steve


>
> > + */
> > + update_rq_clock(later_rq);
> > add_running_bw(&next_task->dl, &later_rq->dl);
> > - activate_task(later_rq, next_task, 0);
> > + activate_task(later_rq, next_task, ENQUEUE_NOCLOCK);
> > ret = 1;
> >
> > resched_curr(later_rq);