2023-08-13 16:34:37

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH v2] blk-mq: release scheduler resource when request complete

On 8/13/23 9:23 AM, [email protected] wrote:
> From: Chengming Zhou <[email protected]>
>
> Chuck reported [1] a IO hang problem on NFS exports that reside on SATA
> devices and bisected to commit 615939a2ae73 ("blk-mq: defer to the normal
> submission path for post-flush requests").
>
> We analysed the IO hang problem, found there are two postflush requests
> are waiting for each other.
>
> The first postflush request completed the REQ_FSEQ_DATA sequence, so go to
> the REQ_FSEQ_POSTFLUSH sequence and added in the flush pending list, but
> failed to blk_kick_flush() because of the second postflush request which
> is inflight waiting in scheduler queue.
>
> The second postflush waiting in scheduler queue can't be dispatched because
> the first postflush hasn't released scheduler resource even though it has
> completed by itself.
>
> Fix it by releasing scheduler resource when the first postflush request
> completed, so the second postflush can be dispatched and completed, then
> make blk_kick_flush() succeed.

Thanks, applied with a bit of commit message massaging and adding a
comment for the newly added WARN_ON_ONCE().

--
Jens Axboe



2023-08-13 16:35:38

by Chengming Zhou

[permalink] [raw]
Subject: Re: [PATCH v2] blk-mq: release scheduler resource when request complete

On 2023/8/13 23:34, Jens Axboe wrote:
> On 8/13/23 9:23 AM, [email protected] wrote:
>> From: Chengming Zhou <[email protected]>
>>
>> Chuck reported [1] a IO hang problem on NFS exports that reside on SATA
>> devices and bisected to commit 615939a2ae73 ("blk-mq: defer to the normal
>> submission path for post-flush requests").
>>
>> We analysed the IO hang problem, found there are two postflush requests
>> are waiting for each other.
>>
>> The first postflush request completed the REQ_FSEQ_DATA sequence, so go to
>> the REQ_FSEQ_POSTFLUSH sequence and added in the flush pending list, but
>> failed to blk_kick_flush() because of the second postflush request which
>> is inflight waiting in scheduler queue.
>>
>> The second postflush waiting in scheduler queue can't be dispatched because
>> the first postflush hasn't released scheduler resource even though it has
>> completed by itself.
>>
>> Fix it by releasing scheduler resource when the first postflush request
>> completed, so the second postflush can be dispatched and completed, then
>> make blk_kick_flush() succeed.
>
> Thanks, applied with a bit of commit message massaging and adding a
> comment for the newly added WARN_ON_ONCE().
>

Ok, thanks!