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

Arnd Bergmann
2009-07-10T15:17:53Z

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.