All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ray Bryant <raybry@sgi.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: Bug in __pollwait() can cause select() and poll() tohang in
Date: Thu, 19 Jun 2003 13:09:23 -0500	[thread overview]
Message-ID: <3EF1FC53.2C9C5249@sgi.com> (raw)
In-Reply-To: 3EF1E136.40305@colorfullife.com

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.

Thanks,
-- 
Best Regards,
Ray
-----------------------------------------------
                  Ray Bryant
512-453-9679 (work)         512-507-7807 (cell)
raybry@sgi.com             raybry@austin.rr.com
The box said: "Requires Windows 98 or better",
           so I installed Linux.
-----------------------------------------------

  reply	other threads:[~2003-06-19 17:55 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 ` Ray Bryant [this message]
2003-06-19 18:21   ` PROBLEM: Bug in __pollwait() can cause select() and poll() tohang in Andrew Morton

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=3EF1FC53.2C9C5249@sgi.com \
    --to=raybry@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.