Re: [PATCH 1/2] sched: Drop the need_resched() loop fromcond_resched()

From: Frederic Weisbecker
Date: Fri Jul 10 2009 - 11:24:41 EST


On Fri, Jul 10, 2009 at 05:17:38PM +0200, Arnd Bergmann wrote:
> On Friday 10 July 2009, Frederic Weisbecker wrote:
> > --- a/kernel/sched.c
> > +++ b/kernel/sched.c
> > @@ -6613,11 +6613,9 @@ static void __cond_resched(void)
> > * PREEMPT_ACTIVE, which could trigger a second
> > * cond_resched() call.
> > */
> > - do {
> > - add_preempt_count(PREEMPT_ACTIVE);
> > - schedule();
> > - sub_preempt_count(PREEMPT_ACTIVE);
> > - } while (need_resched());
> > + add_preempt_count(PREEMPT_ACTIVE);
> > + schedule();
> > + sub_preempt_count(PREEMPT_ACTIVE);
> > }
> >
>
> If you drop the loop, then you should also remove the comment that
> explains why it was put there.
>
> Arnd <><

Hmm, these comments seem to actually explain why we do the PREEMPT_ACTIVE
trick, which is to prevent from cond_resched() recursion, right?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/