Skip to content

Commit

Permalink
blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped"
Browse files Browse the repository at this point in the history
This reverts commit 127276c.

When all CPUs of one hw queue become offline, there still may have IOs
not completed from this hctx. But blk_mq_hw_queue_mapped() is called in
blk_mq_queue_tag_busy_iter(), which is used for iterating request in timeout
handler, timeout event will be missed on the inactive hctx, then request may
never be completed.

Also the replementation of blk_mq_hw_queue_mapped() doesn't match the helper's
name any more, and it should have been named as blk_mq_hw_queue_active().

Even other callers need further verification about this reimplemenation.

So revert this patch now, and we can improve hw queue activate/inactivate event
after adequent researching and test.

Cc: Stefan Haberland <sth@linux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christoph Hellwig <hch@lst.de>
Reported-by: Jens Axboe <axboe@kernel.dk>
Fixes: 	127276c ("blk-mq: reimplement blk_mq_hw_queue_mapped")
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Ming Lei authored and Jens Axboe committed Apr 11, 2018
1 parent 37f9579 commit 2434af7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-mq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 cpumask_first_and(hctx->cpumask, cpu_online_mask) < nr_cpu_ids;
return hctx->nr_ctx && hctx->tags;
}

void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part,
Expand Down

0 comments on commit 2434af7

Please sign in to comment.