From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B177C4363D for ; Wed, 7 Oct 2020 01:06:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA4B3206F7 for ; Wed, 7 Oct 2020 01:06:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H6zNxtep"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ezNEk4wo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA4B3206F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X8ZQgQW6HrfCHT+QzogRP6ovi50ck4TZ+mIH7V4cGTk=; b=H6zNxtepyCIxmS3FDiMUCoCiF +Hm/MK1jlACZoQYT96GJTrS3R4IYwfFFZ7LLH5w6SE7dbD0vMkX/5YjfN9/4ikXIQ66ShVZAlrct5 hoQh3p3LwH+Ldp1Zml4WRXLgO/DliPTeaQXrqB9vb5/r8+MgrDEOdTjVcd44owlwZ34srCLzz/Sig WtWM6fr43Q1sMipj7fxqGO91uSIfvYrQXWbeF15KUbW2SaNrwtoIne9XKrbgZwj0NcStaVqN/W9Fm YcyLQqFSzMo80ZQ3qd1CIhH8L+2L2GZqA+iZupgRZdGFmO61dLcCxMgMhtE4OT7xdGfOvuRGDeaS2 +0a55yEtA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPxua-0005ZK-Aw; Wed, 07 Oct 2020 01:06:32 +0000 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPxuT-0005Wo-Ns for linux-nvme@lists.infradead.org; Wed, 07 Oct 2020 01:06:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602032785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OcTNro04spti2p/S2A1ZPa+JleaPimENQhhyc8a5ofk=; b=ezNEk4woEVpgaN49MoLRQjbJ4hGKI0Tnbi3R8L6Mr9vr1csKhkP5wzQXR6XOnzJvGvaV/e qylePtS3bzr+mskxKHIpVLIwXHMmHvp+qYCs4PFEfZNWJZzncbICga7RqPTejolHzMdYSi NXGJNmM9sYGT1KUAJlOjPiqWclyHkgI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-Vq-FRL6AMsmNxFyrm5C8SQ-1; Tue, 06 Oct 2020 21:05:07 -0400 X-MC-Unique: Vq-FRL6AMsmNxFyrm5C8SQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 383F410BBEC5; Wed, 7 Oct 2020 01:05:05 +0000 (UTC) Received: from localhost (ovpn-12-47.pek2.redhat.com [10.72.12.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75EC45C1BD; Wed, 7 Oct 2020 01:05:04 +0000 (UTC) From: Ming Lei To: Jens Axboe , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Christoph Hellwig , Keith Busch Subject: [PATCH V7 4/4] nvme: use blk_mq_[un]quiesce_tagset Date: Wed, 7 Oct 2020 09:04:43 +0800 Message-Id: <20201007010443.71456-5-ming.lei@redhat.com> In-Reply-To: <20201007010443.71456-1-ming.lei@redhat.com> References: <20201007010443.71456-1-ming.lei@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201006_210625_952492_B7291EF8 X-CRM114-Status: GOOD ( 13.79 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sagi Grimberg , Johannes Thumshirn , Ming Lei , Hannes Reinecke , Chao Leng , Bart Van Assche Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org From: Sagi Grimberg All controller namespaces share the same tagset, so we can use this interface which does the optimal operation for parallel quiesce based on the tagset type (e.g. blocking tagsets and non-blocking tagsets). Reviewed-by: Hannes Reinecke Tested-by: Sagi Grimberg Reviewed-by: Keith Busch Cc: Sagi Grimberg Cc: Bart Van Assche Cc: Johannes Thumshirn Cc: Chao Leng Add code to unquiesce ctrl->connect_q in nvme_stop_queues(), meantime avoid to call blk_mq_quiesce_tagset()/blk_mq_unquiesce_tagset() if this tagset isn't initialized. Signed-off-by: Ming Lei Signed-off-by: Sagi Grimberg --- drivers/nvme/host/core.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index c190c56bf702..2dd2d6ff8e7a 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4623,23 +4623,22 @@ EXPORT_SYMBOL_GPL(nvme_start_freeze); void nvme_stop_queues(struct nvme_ctrl *ctrl) { - struct nvme_ns *ns; + if (list_empty_careful(&ctrl->namespaces)) + return; - down_read(&ctrl->namespaces_rwsem); - list_for_each_entry(ns, &ctrl->namespaces, list) - blk_mq_quiesce_queue(ns->queue); - up_read(&ctrl->namespaces_rwsem); + blk_mq_quiesce_tagset(ctrl->tagset); + + if (ctrl->connect_q) + blk_mq_unquiesce_queue(ctrl->connect_q); } EXPORT_SYMBOL_GPL(nvme_stop_queues); void nvme_start_queues(struct nvme_ctrl *ctrl) { - struct nvme_ns *ns; + if (list_empty_careful(&ctrl->namespaces)) + return; - down_read(&ctrl->namespaces_rwsem); - list_for_each_entry(ns, &ctrl->namespaces, list) - blk_mq_unquiesce_queue(ns->queue); - up_read(&ctrl->namespaces_rwsem); + blk_mq_unquiesce_tagset(ctrl->tagset); } EXPORT_SYMBOL_GPL(nvme_start_queues); -- 2.25.2 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme