On 11/16/21 11:25 PM, Christoph Hellwig wrote: >> @@ -2208,6 +2208,19 @@ static void blk_mq_plug_issue_direct(struct blk_plug *plug, bool from_schedule) >> int queued = 0; >> int errors = 0; >> >> + /* >> + * Peek first request and see if we have a ->queue_rqs() hook. If we >> + * do, we can dispatch the whole plug list in one go. We already know >> + * at this point that all requests belong to the same queue, caller >> + * must ensure that's the case. >> + */ >> + rq = rq_list_peek(&plug->mq_list); >> + if (rq->q->mq_ops->queue_rqs) { >> + rq->q->mq_ops->queue_rqs(&plug->mq_list); >> + if (rq_list_empty(plug->mq_list)) >> + return; >> + } > > I'd move this straight into the caller to simplify the follow, something > like the patch below. Also I wonder if the slow path might want to > be moved from blk_mq_flush_plug_list into a separate helper to keep > the fast path as straight as possible? Yes, I think that's better. I'll fold that in. -- Jens Axboe