lkml.org 
[lkml]   [2003]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: PROBLEM: Bug in __pollwait() can cause select() and poll() to hang in 2.4.21
From
Date
Ray Bryant <raybry@sgi.com> writes:
>
> select() and poll() call a common routine: __pollwait(). On the
> first call to __pollwait(), it calls __get_free_page(GFP_KERNEL) to
> allocate a table to hold wait queues. In the natural course of things,
> this calls into __alloc_pages(). In low memory situations, the process
> can then end up in the rebalance code at the bottom of __alloc_pages()
> where there is a call to yield(). If the process makes this call, this
> is a bad thing [tm], since the process state at that point is
> TASK_INTERRUPTIBLE. There is no wait queue yet for the process (that is
> done later in __pollwait()) and no schedule timeout event has yet been
> created (that is done later in select()) so the process will never
> return from the call to yield().

Nasty bug. How about adding a BUG() for current->state != TASK_RUNNING at
the beginning of __alloc_pages unless GFP_ATOMIC is set?

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.033 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site