Re: [PATCH] fix wait_task_inactive race (was Re: Race condition inptrace)

From: Nick Piggin
Date: Sun Feb 06 2005 - 02:51:35 EST


Nick Piggin wrote:
Ingo Molnar wrote:

* Nick Piggin <nickpiggin@xxxxxxxxxxxx> wrote:


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.



ugh. This has been the Nth time we got bitten by the fundamental
unrobustness of non-atomic scheduling on some architectures ...
(And i'll say the N+1th time that this is not good.)


This is actually due to wake_sleeping_dependent and
dependent_sleeper dropping the runqueue lock.


Hmph, *and* unlocked context switch architectures as you say.
In fact, I'm surprised those haven't been bitten by this problem
earlier.

So that makes us each half right! :)

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