linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@fb.com>,
	linux-block@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>
Cc: Omar Sandoval <osandov@fb.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Hannes Reinecke <hare@suse.com>, Wen Xiong <wenxiong@us.ibm.com>,
	Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>,
	Ming Lei <ming.lei@redhat.com>
Subject: [PATCH V2 2/2] block: drain blkcg part of request_queue in blk_cleanup_queue()
Date: Thu, 23 Nov 2017 12:48:00 +0800	[thread overview]
Message-ID: <20171123044800.25251-3-ming.lei@redhat.com> (raw)
In-Reply-To: <20171123044800.25251-1-ming.lei@redhat.com>

Now once blk_freeze_queue() returns, all requests(in-queue and pending)
can be drained, but we still need to drain blkcg part of request_queue
for both blk-mq and legacy, so this patch calls blkcg_drain_queue()
explicitely in blk_cleanup_queue() to do that.

Then the __blk_drain_queue() in blk_cleanup_queue() can be covered by both
blk_freeze_queue() and blkcg_drain_queue(), and tasks blocked in get_request()
are waken up in blk_set_queue_dying() too, so remove it from blk_cleanup_queue().

Cc: Wen Xiong <wenxiong@us.ibm.com>
Cc: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 1038706edd87..f3f6f11a5b31 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -689,8 +689,7 @@ void blk_cleanup_queue(struct request_queue *q)
 	 */
 	blk_freeze_queue(q);
 	spin_lock_irq(lock);
-	if (!q->mq_ops)
-		__blk_drain_queue(q, true);
+	blkcg_drain_queue(q);
 	queue_flag_set(QUEUE_FLAG_DEAD, q);
 	spin_unlock_irq(lock);
 
-- 
2.9.5

  parent reply	other threads:[~2017-11-23  4:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23  4:47 [PATCH V2 0/2] block: fix queue freeze and cleanup Ming Lei
2017-11-23  4:47 ` [PATCH V2 1/2] block: run queue before waiting for q_usage_counter becoming zero Ming Lei
2017-11-27 12:15   ` Mauricio Faria de Oliveira
2017-11-23  4:48 ` Ming Lei [this message]
2017-11-27 12:15   ` [PATCH V2 2/2] block: drain blkcg part of request_queue in blk_cleanup_queue() Mauricio Faria de Oliveira
2017-11-27 12:41 ` [PATCH V2 0/2] block: fix queue freeze and cleanup Ming Lei
2017-11-29  2:57   ` chenxiang (M)
2017-11-29  4:54     ` Ming Lei
2017-11-29  5:40       ` chenxiang (M)
2017-12-01 15:36     ` Mauricio Faria de Oliveira
2017-12-01 15:42       ` Ming Lei
2017-12-01 16:08       ` Bart Van Assche
2017-12-01 17:35         ` Ming Lei
2017-12-01 18:49         ` Mauricio Faria de Oliveira
2017-12-02  0:49           ` Ming Lei
2017-12-04 12:31             ` Mauricio Faria de Oliveira
2017-12-13 21:49           ` Bart Van Assche
2017-12-20 14:34             ` Mauricio Faria de Oliveira
2017-12-13 21:53     ` Bart Van Assche
2017-12-15  7:58       ` chenxiang (M)
2017-12-15 17:44         ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171123044800.25251-3-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=axboe@fb.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=hare@suse.com \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mauricfo@linux.vnet.ibm.com \
    --cc=osandov@fb.com \
    --cc=wenxiong@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).