summaryrefslogtreecommitdiff
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-06-11 09:44:44 +0300
committerJens Axboe <axboe@kernel.dk>2020-06-24 18:15:57 +0300
commit6aab1da603e731383b342dbe612f92cd222fe56b (patch)
treeb9d3453bf84d25b29513e539531ea981ea1b6063 /block/blk-mq.c
parentdea6f3993812c82b4dd5f61acd41c55a311a445f (diff)
downloadlinux-6aab1da603e731383b342dbe612f92cd222fe56b.tar.xz
blk-mq: complete polled requests directly
Even for single queue devices there is no point in offloading a polled completion to the softirq, given that blk_mq_force_complete_rq is called from the polling thread in that case and thus there are no starvation issues. Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index ada55521601f..ea083f58d9da 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -703,6 +703,16 @@ void blk_mq_force_complete_rq(struct request *rq)
int cpu;
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
+
+ /*
+ * For a polled request, always complete locallly, it's pointless
+ * to redirect the completion.
+ */
+ if (rq->cmd_flags & REQ_HIPRI) {
+ q->mq_ops->complete(rq);
+ return;
+ }
+
/*
* Most of single queue controllers, there is only one irq vector
* for handling IO completion, and the only irq's affinity is set
@@ -717,12 +727,7 @@ void blk_mq_force_complete_rq(struct request *rq)
return;
}
- /*
- * For a polled request, always complete locallly, it's pointless
- * to redirect the completion.
- */
- if ((rq->cmd_flags & REQ_HIPRI) ||
- !test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags)) {
+ if (!test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags)) {
q->mq_ops->complete(rq);
return;
}