mirror of
https://github.com/torvalds/linux.git
synced 2025-01-01 15:51:46 +00:00
blk-mq: don't redirect completion for hctx withs only one ctx mapping
High-performance NVMe devices usually support a large hw queues, which ensures a 1:1 mapping of hctx and ctx. In this case there will be no remote request, so we don't need to care about it. Signed-off-by: Liu Song <liusong@linux.alibaba.com> Link: https://lore.kernel.org/r/1663731123-81536-1-git-send-email-liusong@linux.alibaba.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
81c7a63abc
commit
f168420c62
@ -1093,10 +1093,12 @@ bool blk_mq_complete_request_remote(struct request *rq)
|
|||||||
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
|
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For a polled request, always complete locally, it's pointless
|
* For request which hctx has only one ctx mapping,
|
||||||
* to redirect the completion.
|
* or a polled request, always complete locally,
|
||||||
|
* it's pointless to redirect the completion.
|
||||||
*/
|
*/
|
||||||
if (rq->cmd_flags & REQ_POLLED)
|
if (rq->mq_hctx->nr_ctx == 1 ||
|
||||||
|
rq->cmd_flags & REQ_POLLED)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (blk_mq_complete_need_ipi(rq)) {
|
if (blk_mq_complete_need_ipi(rq)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user