From patchwork Wed Jul 5 06:53:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9825925 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 8A4C9602F0 for ; Wed, 5 Jul 2017 06:54:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 834A9262FF for ; Wed, 5 Jul 2017 06:54:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 763FD26E16; Wed, 5 Jul 2017 06:54:53 +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 EB568262FF for ; Wed, 5 Jul 2017 06:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752104AbdGEGyw (ORCPT ); Wed, 5 Jul 2017 02:54:52 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:59784 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbdGEGyw (ORCPT ); Wed, 5 Jul 2017 02:54:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding: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=z5Ck02wXRlkXM3Xqvybnjt4OXUrxQdgsMHX7QrAv3l8=; b=f8hg7P2PYWO+f0XI4CaiR9t0R YeY7EEvxtvXnTVSjTYdROEoBbuytpuW9kEgaon5a51vHHEw5kixpYAd4XbB3a4uuOV4g75lbZOJ8x l5DA700hWdziGM8RotbLTezaXDdf77x7gbyAbX9XTM9FtpNhcXUXUh1OdLNtY8fzIxDwn6HnWvyo3 bS9w2MxhsT9v8mkmBivYbqSTbz2GJUt7cY+pnwfJVc3Pw7faQxYtVee2EeAsu4PK7hVh0ZAr47S3E bNA6M44B4XgtxDfYXVRLPdNZUzN2e6tImt5MaIkCUL94I8UJkjWtw6WbgsBAKD1Ccvfp8UJXbWmaU Us/j513iQ==; 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 1dSeD2-0008IF-SE; Wed, 05 Jul 2017 06:54:51 +0000 From: Sagi Grimberg To: Jens Axboe , linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Christoph Hellwig , Keith Busch , Ming Lei , Josef Bacik Subject: [PATCH v2 6/8] nbd: quiesce request queues to make sure no submissions are inflight Date: Wed, 5 Jul 2017 09:53:09 +0300 Message-Id: <1499237591-15861-7-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499237591-15861-1-git-send-email-sagi@grimberg.me> References: <1499237591-15861-1-git-send-email-sagi@grimberg.me> 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 Unlike blk_mq_stop_hw_queues, blk_mq_quiesce_queue respects the submission path rcu grace. quiesce the queue before iterating on live tags. Reviewed-by: Ming Lei Cc: Josef Bacik Signed-off-by: Sagi Grimberg --- drivers/block/nbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 977ec960dd2f..dea7d85134ee 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -661,9 +661,9 @@ static void nbd_clear_req(struct request *req, void *data, bool reserved) static void nbd_clear_que(struct nbd_device *nbd) { - blk_mq_stop_hw_queues(nbd->disk->queue); + blk_mq_quiesce_queue(nbd->disk->queue); blk_mq_tagset_busy_iter(&nbd->tag_set, nbd_clear_req, NULL); - blk_mq_start_hw_queues(nbd->disk->queue); + blk_mq_unquiesce_queue(nbd->disk->queue); dev_dbg(disk_to_dev(nbd->disk), "queue cleared\n"); }