Re: PROBLEM: Bug in __pollwait() can cause select() and poll() tohang in

From: Ray Bryant (
Date: Thu Jun 19 2003 - 13:09:23 EST

Manfred Spraul wrote:
> Hi Ray,
> your bug description seems to be correct, but the fix is wrong:
> If the allocation is for the 2nd page of wait queue heads, then
> "current->state = TASK_INTERRUPTIBLE" can lead to lost wakeups, if an fd
> that is stored in the first page gets ready during the allocation.

Hi Manfred,

Grumble. :-) Yes, I believe you are correct.

> Setting the state to interruptible is only permitted if a full scan of
> all file descriptors happens before calling schedule(). This is
> expensive and should be avoided.
> The correct fix is current->state = TASK_RUNNING just before calling
> yield() in the rebalance code.

But doesn't this have the same kind of problem? e. g., just before
calling yield() in the rebalance code we save current->state, set it to
TASK_RUNNING, then restore current->state on return from yield(). If a
fd becomes ready after the call to yield(), and we entered
__alloc_pages() with state TASK_INTERRUPTIBLE, aren't we in exactly the
same situation as described above?

Let me think about this some more.


Best Regards,
                  Ray Bryant
512-453-9679 (work)         512-507-7807 (cell)   
The box said: "Requires Windows 98 or better",
           so I installed Linux.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:30 EST