Re: [RFC -v3 PATCH 2/3] sched: add yield_to function

Mike Galbraith
2011-01-04T18:53:33Z

On Tue, 2011-01-04 at 19:04 +0100, Peter Zijlstra wrote:

> > + p_cfs_rq = cfs_rq_of(pse);
> > + yield = 1;
> > + }
> > +#endif
> > +
> > + if (yield)
> > + clear_buddies(cfs_rq, se);
> > + else if (preempt)
> > + clear_buddies(p_cfs_rq, curr);
> > +
> > + /* Tell the scheduler that we'd really like pse to run next. */
> > + p_cfs_rq->next = pse;
> > +
> > + if (!yield && preempt)
> > + resched_task(task_of(p_cfs_rq->curr));
>
> I don't get this.. Why would you resched the remote cpu, surely you
> didn't just pull its current task over..

:) hope not. Caller bails on task_running(p_rq, p). wants a comment
too I suppose.

Target doesn't live here, preempt is still set/allowed, so we want the
remote cpu to schedule.

-Mike