All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped"
@ 2018-04-11 10:47 Ming Lei
  2018-04-11 13:19 ` Sagi Grimberg
  2018-04-11 13:59 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Ming Lei @ 2018-04-11 10:47 UTC (permalink / raw)
  To: Jens Axboe, linux-block
  Cc: Ming Lei, Stefan Haberland, Christian Borntraeger,
	Christoph Hellwig, Sagi Grimberg

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 <sth@linux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Reported-by: Jens Axboe <axboe@kernel.dk>
Fixes: 	127276c6ce5a30fcc ("blk-mq: reimplement blk_mq_hw_queue_mapped")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-mq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.h b/block/blk-mq.h
index 502af371b83b..88c558f71819 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 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,
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped"
  2018-04-11 10:47 [PATCH] blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped" Ming Lei
@ 2018-04-11 13:19 ` Sagi Grimberg
  2018-04-11 13:59 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2018-04-11 13:19 UTC (permalink / raw)
  To: Ming Lei, Jens Axboe, linux-block
  Cc: Stefan Haberland, Christian Borntraeger, Christoph Hellwig

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped"
  2018-04-11 10:47 [PATCH] blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped" Ming Lei
  2018-04-11 13:19 ` Sagi Grimberg
@ 2018-04-11 13:59 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-04-11 13:59 UTC (permalink / raw)
  To: Ming Lei, linux-block
  Cc: Stefan Haberland, Christian Borntraeger, Christoph Hellwig,
	Sagi Grimberg

On 4/11/18 4:47 AM, Ming Lei wrote:
> 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.

Thanks, applied.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-11 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11 10:47 [PATCH] blk-mq: Revert "blk-mq: reimplement blk_mq_hw_queue_mapped" Ming Lei
2018-04-11 13:19 ` Sagi Grimberg
2018-04-11 13:59 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.