diff mbox series

[05/12] blk-mq: short cut the IPI path in blk_mq_force_complete_rq for !SMP

Message ID 20200611064452.12353-6-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/12] blk-mq: merge blk-softirq.c into blk-mq.c | expand

Commit Message

Christoph Hellwig June 11, 2020, 6:44 a.m. UTC
Let the compile optimize out the entire IPI path, given that we are
obviously not going to use it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-mq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Daniel Wagner June 18, 2020, 3:52 p.m. UTC | #1
On Thu, Jun 11, 2020 at 08:44:45AM +0200, Christoph Hellwig wrote:
> Let the compile optimize out the entire IPI path, given that we are
> obviously not going to use it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Daniel Wagner <dwagner@suse.de>
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 25ce40b367a635..059d30c522f2ad 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -727,7 +727,8 @@  void blk_mq_force_complete_rq(struct request *rq)
 		return;
 	}
 
-	if (!test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags)) {
+	if (!IS_ENABLED(CONFIG_SMP) ||
+	    !test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags)) {
 		q->mq_ops->complete(rq);
 		return;
 	}