All of lore.kernel.org
 help / color / mirror / Atom feed
From: Asias He <asias@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Tejun Heo <tj@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] block: Avoid missed wakeup in request waitqueue
Date: Wed, 06 Jun 2012 10:14:42 +0800	[thread overview]
Message-ID: <4FCEBD12.4030706@redhat.com> (raw)
In-Reply-To: <20120529012115.GE20954@dhcp-172-17-108-109.mtv.corp.google.com>

Hello, Jens

On 05/29/2012 09:21 AM, Tejun Heo wrote:
> On Tue, May 29, 2012 at 09:15:00AM +0800, Asias He wrote:
>> After hot-unplug a stressed disk, I found that rl->wait[] is not empty
>> while rl->count[] is empty and there are theads still sleeping on
>> get_request after the queue cleanup. With simple debug code, I found
>> there are exactly nr_sleep - nr_wakeup of theads in D state. So there
>> are missed wakeup.
>>
>>    $ dmesg | grep nr_sleep
>>    [   52.917115] --->  nr_sleep=1046, nr_wakeup=873, delta=173
>>    $ vmstat 1
>>    1 173  0 712640  24292  96172 0 0  0  0  419  757  0  0  0 100  0
>>
>> To quote Tejun:
>>
>>    Ah, okay, freed_request() wakes up single waiter with the assumption
>>    that after the wakeup there will at least be one successful allocation
>>    which in turn will continue the wakeup chain until the wait list is
>>    empty - ie. waiter wakeup is dependent on successful request
>>    allocation happening after each wakeup.  With queue marked dead, any
>>    woken up waiter fails the allocation path, so the wakeup chaining is
>>    lost and we're left with hung waiters. What we need is wake_up_all()
>>    after drain completion.
>>
>> This patch fixes the missed wakeup by waking up all the theads which
>> are sleeping on wait queue after queue drain.
>>
>> Changes in v2: Drop waitqueue_active() optimization
>>
>> Signed-off-by: Asias He<asias@redhat.com>
>
> Acked-by: Tejun Heo<tj@kernel.org>
>
> Jens, this one wants Cc: stable.

Ping.

-- 
Asias

  reply	other threads:[~2012-06-06  2:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28  4:19 [PATCH] block: Avoid missed wakeup in request waitqueue Asias He
2012-05-28 10:26 ` Tejun Heo
2012-05-29  1:15   ` [PATCH V2] " Asias He
2012-05-29  1:21     ` Tejun Heo
2012-06-06  2:14       ` Asias He [this message]
2012-05-29  1:16   ` [PATCH] " Asias He

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=4FCEBD12.4030706@redhat.com \
    --to=asias@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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.