It is natural to release driver tag when this request is completed by
LLD or device since its purpose is for LLD use.
One big benefit is that the released tag can be re-used quicker since
bio_endio() may take too long.
Meantime we don't need to release driver tag for flush request.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
blk_mq_tag_set_rq(hctx, flush_rq->tag, fq->orig_rq);
flush_rq->tag = -1;
} else {
- blk_mq_put_driver_tag(flush_rq);
flush_rq->internal_tag = -1;
}
unsigned long flags;
struct blk_flush_queue *fq = blk_get_flush_queue(q, ctx);
- if (q->elevator) {
- WARN_ON(rq->tag < 0);
- blk_mq_put_driver_tag(rq);
- }
-
/*
* After populating an empty queue, kick it to avoid stall. Read
* the comment in flush_end_io().
{
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
+ blk_mq_put_driver_tag(rq);
+
/*
* For a polled request, always complete locallly, it's pointless
* to redirect the completion.