Thread (5 messages) 5 messages, 3 authors, 2017-11-22

Re: [PATCH] block: drain queue before waiting for q_usage_counter becoming zero

From: Ming Lei <hidden>
Date: 2017-11-22 22:28:57

On Wed, Nov 22, 2017 at 04:47:48PM +0000, Bart Van Assche wrote:
On Wed, 2017-11-22 at 13:11 +0800, Ming Lei wrote:
quoted
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 11097477eeab..3d3797327491 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -161,6 +161,8 @@ void blk_freeze_queue(struct request_queue *q)
 	 * exported to drivers as the only user for unfreeze is blk_mq.
 	 */
 	blk_freeze_queue_start(q);
+	if (!q->mq_ops)
+		blk_drain_queue(q);
 	blk_mq_freeze_queue_wait(q);
 }
Since q_usage_counter now tracks legacy requests, is there any reason why we
still need __blk_drain_queue()? Have you considered to eliminate
__blk_drain_queue() and to call blk_run_queue() from inside blk_freeze_queue()
instead of calling blk_drain_queue()? I'm asking this because
Yeah, that looks better, I am thinking of that too, will do this way
in V2.

-- 
Ming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help