lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 06 Jun 2012 10:14:42 +0800
From:	Asias He <asias@...hat.com>
To:	Jens Axboe <axboe@...nel.dk>
CC:	Tejun Heo <tj@...nel.org>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] block: Avoid missed wakeup in request waitqueue

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@...hat.com>
>
> Acked-by: Tejun Heo<tj@...nel.org>
>
> Jens, this one wants Cc: stable.

Ping.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ