Re: [PATCH] One-liner typo 2.5.3-pre3 in ppc/kernel/idle.c

From: Anton Blanchard (anton@samba.org)
Date: Wed Jan 23 2002 - 00:31:18 EST


> Looks like need_resched conversion error.

Actually there is a (badly commented) optimisation here. (OK so it isn't
commented at all :)

The code used to say:

        int oldval = xchg(&current->need_resched, -1);

        if (!oldval) {
                while(current->need_resched == -1)
                        ; /* Do Nothing */
        }

We atomically grab the current value of need_resched and replace it with
-1. The -1 tells the scheduler that we are busy looping and it doesnt need
to send an IPI to force a reschedule.

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



This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:01:01 EST