Re: [PATCH v3 4/4] blk-flush: reuse rq queuelist in flush state machine

From: Ming Lei
Date: Fri Jul 07 2023 - 06:07:42 EST


On Fri, Jul 07, 2023 at 05:37:22PM +0800, chengming.zhou@xxxxxxxxx wrote:
> From: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
>
> Since we don't need to maintain inflight flush_data requests list
> anymore, we can reuse rq->queuelist for flush pending list.
>
> Note in mq_flush_data_end_io(), we need to re-initialize rq->queuelist
> before reusing it in the state machine when end, since the rq->rq_next
> also reuse it, may have corrupted rq->queuelist by the driver.
>
> This patch decrease the size of struct request by 16 bytes.
>
> Signed-off-by: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> ---
> v3:
> - fix a bug report of blktests nvme/012, we need to re-initialize
> rq->queuelist before reusing it in the state machine when end.
> Because rq->rq_next reuse may have corrupted it. Thanks Ming Lei.

Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>

Thanks,
Ming