lkml.org 
[lkml]   [2012]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 2/4] sched: Push put_prev_task() into pick_next_task()
From
Date
On Thu, 2012-06-21 at 15:35 +0800, Michael Wang wrote:
> > +pick_next_task_fair(struct rq *rq, struct task_struct *prev)
> > {
> > struct task_struct *p;
> > struct cfs_rq *cfs_rq = &rq->cfs;
> > @@ -2999,6 +3000,9 @@ static struct task_struct *pick_next_tas
> > if (!cfs_rq->nr_running)
> > return NULL;
> >
> > + if (prev)
> > + prev->sched_class->put_prev_task(rq, prev);
> > +
> > do {
> > se = pick_next_entity(cfs_rq);
> > set_next_entity(cfs_rq, se);
> > --- a/kernel/sched/idle_task.c
> > +++ b/kernel/sched/idle_task.c
> > @@ -22,8 +22,12 @@ static void check_preempt_curr_idle(stru
> > resched_task(rq->idle);
> > }
>
> Will it cause trouble when the last task on cfs_rq was dequeued before
> been putted?
>
> The cfs_rq->nr_running will be 0 and we will miss the chance to put
> prev, will we?

pick_next_task_idle() will then do the put, no?


\
 
 \ /
  Last update: 2012-06-21 11:21    [W:1.947 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site