Skip to contentSkip to conversation

blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped"

PATCH Applied Ming Lei 3 participants 3 messages Apr 11, 2018 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped"

This reverts commit 127276c6ce5a30fcc806b7fe53015f4f89b62956.

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 <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Sagi Grimberg <[email protected]>
Fixes 127276c6ce5a30fcc ("blk-mq: reimplement blk_mq_hw_queue_mapped")
---
 block/blk-mq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.h +1 -1
index 502af371b83b..88c558f71819 100644
@@ -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,
Signature · 1 line
2.9.5
maintainer Applied
#2 lore raw
In reply to Ming Lei
Quoted 8 lines · Ming Lei

This reverts commit 127276c6ce5a30fcc806b7fe53015f4f89b62956.

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.

Quoted 7 lines

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.

Thanks, applied.

Signature · 1 line
Jens Axboe