Skip to content

Commit

Permalink
blk-mq: short cut the IPI path in blk_mq_force_complete_rq for !SMP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jun 24, 2020
1 parent 6aab1da commit d6cc464
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d6cc464

Please sign in to comment.