[PATCH 4/4] block: Make blk_cleanup_queue() faster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since blk_cleanup_queue() waits until q->q_usage_counter drops to zero
before setting the "dead" flag, it is guaranteed that all requests that
were in progress when blk_cleanup_queue() was called have finished before
the "dead" flag is set. This means it is not possible that any .queue_rq()
call is ongoing while the "dead" flag is set. Hence remove the code that
waits for ongoing .queue_rq() calls to finish after the "dead" flag has
been set. See also commit c2856ae2f315 ("blk-mq: quiesce queue before
freeing queue") # v4.16.

Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Cc: Hannes Reinecke <hare@xxxxxxxx>
Cc: James Smart <james.smart@xxxxxxxxxxxx>
Cc: Ming Lei <ming.lei@xxxxxxxxxx>
Cc: Jianchao Wang <jianchao.w.wang@xxxxxxxxxx>
Cc: Dongli Zhang <dongli.zhang@xxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
 block/blk-core.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index bfdbdbb8ec65..2921af6f8d33 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -348,18 +348,6 @@ void blk_cleanup_queue(struct request_queue *q)
 
 	blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
 
-	/*
-	 * make sure all in-progress dispatch are completed because
-	 * blk_freeze_queue() can only complete all requests, and
-	 * dispatch may still be in-progress since we dispatch requests
-	 * from more than one contexts.
-	 *
-	 * We rely on driver to deal with the race in case that queue
-	 * initialization isn't done.
-	 */
-	if (queue_is_mq(q) && blk_queue_init_done(q))
-		blk_mq_quiesce_queue(q);
-
 	/* for synchronous bio-based driver finish in-flight integrity i/o */
 	blk_flush_integrity();
 
-- 
2.21.0.196.g041f5ea1cf98




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux