From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:47842 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231AbdKWEs2 (ORCPT ); Wed, 22 Nov 2017 23:48:28 -0500 From: Ming Lei To: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig Cc: Omar Sandoval , Bart Van Assche , Hannes Reinecke , Wen Xiong , Mauricio Faria de Oliveira , Ming Lei Subject: [PATCH V2 1/2] block: run queue before waiting for q_usage_counter becoming zero Date: Thu, 23 Nov 2017 12:47:59 +0800 Message-Id: <20171123044800.25251-2-ming.lei@redhat.com> In-Reply-To: <20171123044800.25251-1-ming.lei@redhat.com> References: <20171123044800.25251-1-ming.lei@redhat.com> Sender: linux-block-owner@vger.kernel.org List-Id: linux-block@vger.kernel.org Now we track legacy requests with .q_usage_counter in commit 055f6e18e08f ("block: Make q_usage_counter also track legacy requests"), but that commit never runs legacy queue before waiting for this counter becoming zero, then IO hang is caused in the test of pulling disk during IO. This patch fixes the issue by running queue in blk_freeze_queue_start() like blk-mq before waiting for q_usage_counter becoming zero. Fixes: 055f6e18e08f("block: Make q_usage_counter also track legacy requests") Cc: Wen Xiong Cc: Mauricio Faria de Oliveira Suggested-by: Bart Van Assche Signed-off-by: Ming Lei --- block/blk-mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 11097477eeab..e2b6a57b004d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -128,6 +128,8 @@ void blk_freeze_queue_start(struct request_queue *q) percpu_ref_kill(&q->q_usage_counter); if (q->mq_ops) blk_mq_run_hw_queues(q, false); + else + blk_run_queue(q); } } EXPORT_SYMBOL_GPL(blk_freeze_queue_start); -- 2.9.5