From: Jens Axboe Date: Sun, 18 Nov 2018 23:15:35 +0000 (-0700) Subject: blk-mq: never redirect polled IO completions X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4ab32bf3305eedb4d31f85cac68a67becab10494;p=linux.git blk-mq: never redirect polled IO completions It's pointless to do so, we are by definition on the CPU we want/need to be, as that's the one waiting for a completion event. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index ba3c7b6476b77..37674c1766a75 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -585,7 +585,12 @@ static void __blk_mq_complete_request(struct request *rq) return; } - if (!test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags)) { + /* + * 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)) { q->mq_ops->complete(rq); return; }