public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Ray Bryant <raybry@sgi.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: Bug in __pollwait() can cause select() and poll() to hang in   2.4.21
Date: 19 Jun 2003 18:42:31 +0200	[thread overview]
Message-ID: <p733ci65894.fsf@oldwotan.suse.de> (raw)
In-Reply-To: <3EF1D830.F12113D@sgi.com.suse.lists.linux.kernel>

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

       reply	other threads:[~2003-06-19 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3EF1D830.F12113D@sgi.com.suse.lists.linux.kernel>
2003-06-19 16:42 ` Andi Kleen [this message]
2003-06-19 17:18   ` PROBLEM: Bug in __pollwait() can cause select() and poll() to hang in 2.4.21 Ray Bryant
2003-06-19 15:35 Ray Bryant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p733ci65894.fsf@oldwotan.suse.de \
    --to=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raybry@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox