Re: [patch] new-task-fix.patch, 2.6.8.1-mm1

From: Nick Piggin
Date: Tue Aug 17 2004 - 06:37:03 EST




Ingo Molnar wrote:

* Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:



Looking through 2.6.8.1-mm1, I see this code which doesn't make sense:





So, first off, the statements under "if (unlikely(cpu != this_cpu))"
can be folded into the previous block, since that's under the same
test. Secondly, why is sleep_avg being set twice to the same thing,
and why are we happy to adjust it the first time without holding the
rq lock for current, but the second time we make sure we are holding
the rq lock? [...]



agreed, this is a bug - the code has rotten somewhat. The attached patch
fixes it. I've also cleaned up the locking and added this_rq, to make
clear when and how we are hopping from one runqueue to another. (this
cleanup would have made the original bug more obvious as well.)

This comes after sched-nonlinear-timeslicespatch.patch in 2.6.8.1-mm1. Tested on x86.




Looks OK to me. Thanks Ingo, Rusty.

-
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/