From: Andrew Morton <akpm@digeo.com>
To: Ray Bryant <raybry@sgi.com>
Cc: manfred@colorfullife.com, linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: Bug in __pollwait() can cause select() and poll() tohang in
Date: Thu, 19 Jun 2003 11:21:02 -0700 [thread overview]
Message-ID: <20030619112102.6a528a29.akpm@digeo.com> (raw)
In-Reply-To: <3EF1FC53.2C9C5249@sgi.com>
Ray Bryant <raybry@sgi.com> wrote:
>
> > 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?
No, you cannot restore the task state after having set it to TASK_RUNNING.
Just leave the state at TASK_RUNNING. The (silly) code which called the
page allocator in state TASK_[IN]TERRUPTIBLE will just go around its wait
loop an extra time and go back to sleep. This almost always works.
prev parent reply other threads:[~2003-06-19 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-19 16:13 PROBLEM: Bug in __pollwait() can cause select() and poll() to hang in Manfred Spraul
2003-06-19 18:09 ` PROBLEM: Bug in __pollwait() can cause select() and poll() tohang in Ray Bryant
2003-06-19 18:21 ` Andrew Morton [this message]
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=20030619112102.6a528a29.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--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