lkml.org 
[lkml]   [2018]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2] sched/deadline: Update rq_clock of later_rq when pushing a task
On Mon, 16 Jul 2018 13:45:21 +0300
Kirill Tkhai <ktkhai@virtuozzo.com> 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@goodmis.org>

-- 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);

\
 
 \ /
  Last update: 2018-08-02 04:46    [W:1.542 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site