From: Ming Lei Date: Sun, 8 Apr 2018 09:48:13 +0000 (+0800) Subject: blk-mq: reimplement blk_mq_hw_queue_mapped X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=127276c6ce5a30fcc806b7fe53015f4f89b62956;p=linux.git blk-mq: reimplement blk_mq_hw_queue_mapped Now the actual meaning of queue mapped is that if there is any online CPU mapped to this hctx, so implement blk_mq_hw_queue_mapped() in this way. Cc: Stefan Haberland Tested-by: Christian Borntraeger Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Ming Lei Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.h b/block/blk-mq.h index 88c558f718190..502af371b83bf 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -181,7 +181,7 @@ static inline bool blk_mq_hctx_stopped(struct blk_mq_hw_ctx *hctx) static inline bool blk_mq_hw_queue_mapped(struct blk_mq_hw_ctx *hctx) { - return hctx->nr_ctx && hctx->tags; + return cpumask_first_and(hctx->cpumask, cpu_online_mask) < nr_cpu_ids; } void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part,