One-liner typo 2.5.3-pre3 in ppc/kernel/idle.c
PATCH 1/1 One-liner typo 2.5.3-pre3 in ppc/kernel/idle.c
Looks like need_resched conversion error.
Cheers!
Rusty.
arch/ppc/kernel/idle.c +1 -1
@@ -66,7 +67,7 @@int oldval =xchg (¤t->need_resched,-1 );if (!oldval) { -while (need_resched ()) +while (!need_resched ())barrier ();/* Do Nothing */ } }
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Quoted 2 lines
Looks like
need_reschedconversion 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(¤t->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
In message <20020123053118.GB14366@krispykreme> you write:
Quoted 3 lines
We atomically grab the current value of
need_reschedand 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.
Yes, but the replacment loop was completely wrong. Sure, with my patch this optimization isn't there, but at least it will work as designed...
Cheers!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.