Nick Piggin wrote: > Something like the following (untested) extension of Bodo's work > could be the minimal fix for 2.6.11. As I've said though, I'd > consider it a hack and prefer to do something about the locking. > That could be done after 2.6.11 though. Depends how you feel. > I think this is the right fix. When a task is put to sleep, it is dequeued from the runqueue while it is still running. The problem is that the runqueue lock can be dropped and retaken in schedule() before the task actually schedules off, and wait_task_inactive did not account for this. I introduced a new function to resolve this state, fixed wait_task_inactive, and converted over an open coded test. I did a quick audit of sched.c, and nothing else seems to have made the same mistake. Signed-off-by: Nick Piggin Question: why does wait_task_inactive have different semantics for UP && PREEMPT than SMP && PREEMPT? I can see that the kthread caler probably isn't used in the UP case, but technically it is relying on behaviour that it doesn't get with UP and PREEMPT. Looks like the ptrace.c caller won't care. But still, can we either fix it or put a nice comment there? Preferably fix, if this isn't a very performance critical path?