Re: [PATCH v2 08/13] blk-mq: simplify flush check in blk_mq_dispatch_rq_list

From: Kemeng Shi
Date: Sun Jan 08 2023 - 21:27:46 EST



Hi, Christoph, thank you so much for review.
on 1/9/2023 2:06 AM, Christoph Hellwig wrote:
> I think we need to come up with a clear rule on when commit_rqs
> needs to be called, and follow that. In this case I'd be confused
> if there was any case where we need to call it if list was empty.
>
After we queue request[s] to one driver queue, we need to notify driver
that there are no more request to the queue or driver will keep waiting
for the last request to be queued and IO hung could happen.
Normaly, we will notify this by setting .last in struct blk_mq_queue_data
along with the normal last request .rq in struct blk_mq_queue_data. The
extra commit is only needed if normal last information in .last is lost.
(See comment in struct blk_mq_ops for commit_rqs).

The lost could occur if error happens for sending last request with .last
set or error happen in middle of list and we even do not send the request
with .last set.

--
Best wishes
Kemeng Shi