From patchwork Tue Jul 4 07:55:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9824267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8EE7060237 for ; Tue, 4 Jul 2017 07:56:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80D2F205AF for ; Tue, 4 Jul 2017 07:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73F0A25F3E; Tue, 4 Jul 2017 07:56:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEEE9269DA for ; Tue, 4 Jul 2017 07:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbdGDH4e (ORCPT ); Tue, 4 Jul 2017 03:56:34 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:48286 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752215AbdGDH4e (ORCPT ); Tue, 4 Jul 2017 03:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6QplyhYsiquy2o43Jckr+M0bUTqu6lIs97vIgncdi3Y=; b=DNMdJyNSus5ozh2rwTys8o+JT 9sE4t7rPfJczjdJC+HSQI2XAJ7BcFuW6I3CMREcDRcKzfnWhoj524JMgLKXVeQimMb6f+4z5U2AUW 6lNaCWK193zk5WX8HA06z/MWkEB0HzmP7V3vFbNjcCfA5dcioIbqyrOeCxlGP6SJTFDFAZrii8l7l Gj4atYBy4gvTto4Vznaflx3vhUfcBElwfAbwxZPvCn+cZnbaxQVqD+qrGhsuQbxtz8H9ziXmIo7v+ GNE+4ijryIfwXnuwJHHGzhMaTDizTPuOKh/u0hW7iuGJDFVU/xKKc4R7QCLThI4AZe9paHGvPUmld Fbvfb9EBQ==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dSIhA-0001E3-GA; Tue, 04 Jul 2017 07:56:30 +0000 From: Sagi Grimberg To: Jens Axboe , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Keith Busch , Konrad Rzeszutek Wilk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Boris Ostrovsky , Juergen Gross Subject: [PATCH 8/8] xen-blockfront: quiesce IO before device removal Date: Tue, 4 Jul 2017 10:55:12 +0300 Message-Id: <1499154912-10420-9-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499154912-10420-1-git-send-email-sagi@grimberg.me> References: <1499154912-10420-1-git-send-email-sagi@grimberg.me> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before calling blk_cleanup_queue one must make sure that no request is being queued. In order to guarantee that we need to use blk_mq_quiesce as it respects the submission path rcu grace. Cc: Konrad Rzeszutek Wilk Cc: Roger Pau Monné Cc: Boris Ostrovsky Cc: Juergen Gross Signed-off-by: Sagi Grimberg --- drivers/block/xen-blkfront.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c852ed3c01d5..5272ca8fb0dc 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1187,7 +1187,7 @@ static void xlvbd_release_gendisk(struct blkfront_info *info) return; /* No more blkif_request(). */ - blk_mq_stop_hw_queues(info->rq); + blk_mq_quiesce_queue(info->rq); for (i = 0; i < info->nr_rings; i++) { struct blkfront_ring_info *rinfo = &info->rinfo[i]; @@ -1217,7 +1217,7 @@ static void xlvbd_release_gendisk(struct blkfront_info *info) static inline void kick_pending_request_queues_locked(struct blkfront_ring_info *rinfo) { if (!RING_FULL(&rinfo->ring)) - blk_mq_start_stopped_hw_queues(rinfo->dev_info->rq, true); + blk_mq_unquiesce_queue(rinfo->dev_info->rq); } static void kick_pending_request_queues(struct blkfront_ring_info *rinfo) @@ -1346,7 +1346,7 @@ static void blkif_free(struct blkfront_info *info, int suspend) BLKIF_STATE_SUSPENDED : BLKIF_STATE_DISCONNECTED; /* No more blkif_request(). */ if (info->rq) - blk_mq_stop_hw_queues(info->rq); + blk_mq_quiesce_queue(info->rq); for (i = 0; i < info->nr_rings; i++) blkif_free_ring(&info->rinfo[i]); @@ -2032,7 +2032,7 @@ static int blkif_recover(struct blkfront_info *info) BUG_ON(req->nr_phys_segments > segs); blk_mq_requeue_request(req, false); } - blk_mq_start_stopped_hw_queues(info->rq, true); + blk_mq_unquiesce_queue(info->rq); blk_mq_kick_requeue_list(info->rq); while ((bio = bio_list_pop(&info->bio_list)) != NULL) {