Messages in this thread | | | Subject | Re: [RFC 0/12][PATCH] SCHED_DEADLINE: fork and terminate task logic | From | Raistlin <> | Date | Wed, 13 Jan 2010 12:11:07 +0100 |
| |
On Tue, 2009-12-29 at 16:20 +0100, Peter Zijlstra wrote: > > - if (!rt_prio(p->prio)) > > + /* > > + * the child will be SCHED_DEADLINE, but with zero bandwidth. > > + * The parent (or some other task) must call setscheduler_ex > > + * on it, or it won't ever start. > > + */ > > + init_deadline_task(p); > > + p->dl.flags &= ~DL_NEW; > > + p->dl.flags |= DL_THROTTLED; > > I recently added ->task_fork(), which is called after the class > assignment. > Saw that, and it is being of great help! :-P
> > + } else if (rt_prio(p->prio)) > > + p->sched_class = &rt_sched_class; > > + else > > p->sched_class = &fair_sched_class; > > > > #ifdef CONFIG_SMP > > @@ -2744,6 +2756,10 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev) > > if (mm) > > mmdrop(mm); > > if (unlikely(prev_state == TASK_DEAD)) { > > + /* a deadline task is dying: stop the bandwidth timer */ > > + if (deadline_task(prev)) > > + hrtimer_cancel(&prev->dl.dl_timer); > > + > > /* > > * Remove function-return probe instances associated with this > > * task and put them back on the free list. > > Shouldn't this be done in the ->dequeue_task() callback? > Not sure of this snippet... Actually, it is one of the most disturbing piece of code of this whole scheduler. :-(
The reason why it is here is that I think it is needed to call hrtimer_cancel() _without_ holding the rq->lock, is that correct?
It is
Thanks and regards, Dario
-- <<This happens because I choose it to happen!>> (Raistlin Majere) ---------------------------------------------------------------------- Dario Faggioli, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa (Italy)
http://blog.linux.it/raistlin / raistlin@ekiga.net / dario.faggioli@jabber.org [unhandled content-type:application/pgp-signature] | |