From: Christoph Hellwig <hch@lst.de>
Date: Thu, 11 Jun 2020 08:44:45 +0200
Subject: [PATCH] blk-mq: short cut the IPI path in blk_mq_force_complete_rq
for !SMP
References: bsc#1175995,jsc#SLE-15608
Git-commit: d6cc464cc58424e137eca5e0a53226291044f5d2
Patch-mainline: v5.9-rc1
Let the compile optimize out the entire IPI path, given that we are
obviously not going to use it.
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
block/blk-mq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index d3634458ec31..08ab65e14884 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -701,7 +701,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;
}
--
2.16.4