On 4/17/23 05:09, Christoph Hellwig wrote: > Currently both requeues of commands that were already sent to the > driver and flush commands submitted from the flush state machine > share the same requeue_list struct request_queue, despite requeues > doing head insertations and flushes not. Switch to using two > separate lists instead. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> Looks OK. Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx> > --- > block/blk-flush.c | 9 +++++++-- > block/blk-mq-debugfs.c | 1 - > block/blk-mq.c | 36 +++++++++++++++--------------------- > block/blk-mq.h | 1 - > include/linux/blk-mq.h | 4 +--- > include/linux/blkdev.h | 1 + > 6 files changed, 24 insertions(+), 28 deletions(-) > > diff --git a/block/blk-flush.c b/block/blk-flush.c > index 69e9806f575455..231d3780e74ad1 100644 > --- a/block/blk-flush.c > +++ b/block/blk-flush.c > @@ -188,7 +188,9 @@ static void blk_flush_complete_seq(struct request *rq, > > case REQ_FSEQ_DATA: > list_move_tail(&rq->flush.list, &fq->flush_data_in_flight); > - blk_mq_add_to_requeue_list(rq, 0); > + spin_lock(&q->requeue_lock); > + list_add_tail(&rq->queuelist, &q->flush_list); > + spin_unlock(&q->requeue_lock); > blk_mq_kick_requeue_list(q); With this change, this function name is a little misleading... But I do not have a better name to propose :)