Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1371799

Re: [RFC v2 3/7] Improve the tracking of active utilisation

From luca abeni <luca.abeni@unitn.it>
Newsgroups linux.kernel
Subject Re: [RFC v2 3/7] Improve the tracking of active utilisation
Date 2016-04-05 19:10 +0200
Message-ID <rkCEj-7qs-29@gated-at.bofh.it> (permalink)
References <rj91E-6gd-5@gated-at.bofh.it> <rj9bl-6jH-31@gated-at.bofh.it> <rkyAG-3wP-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Peter,

On Tue, 5 Apr 2016 14:42:42 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Fri, Apr 01, 2016 at 05:12:29PM +0200, Luca Abeni wrote:
> > @@ -526,7 +575,18 @@ static void update_dl_entity(struct sched_dl_entity *dl_se,
> >  	struct dl_rq *dl_rq = dl_rq_of_se(dl_se);
> >  	struct rq *rq = rq_of_dl_rq(dl_rq);
> >  
> > -	add_running_bw(dl_se, dl_rq);
> > +	/*
> > +	 * If the "inactive timer" is still active, stop it and leave
> > +	 * the active utilisation unchanged.
> > +	 * Otherwise, increase the active utilisation.
> > +	 * If the timer cannot be cancelled, inactive_task_timer() will
> > +	 * find the task state as TASK_RUNNING, and will do nothing, so
> > +	 * we are still safe.
> > +	 */
> > +	if (hrtimer_active(&dl_se->inactive_timer))
> > +		hrtimer_try_to_cancel(&dl_se->inactive_timer);
> 
> _try_, what happens if that fails?

I think inactive_task_timer() will run, but will see p->state == TASK_RUNNING
and will return immediately.

I think I have actually seen this happening during my tests, because adding
the "if (p->state == TASK_RUNNING)" in inactive_task_timer() fixed some issues
that I was seeing.



				Thanks,
					Luca

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [RFC v2 3/7] Improve the tracking of active utilisation Peter Zijlstra <peterz@infradead.org> - 2016-04-05 14:50 +0200
  Re: [RFC v2 3/7] Improve the tracking of active utilisation luca abeni <luca.abeni@unitn.it> - 2016-04-05 19:10 +0200

csiph-web