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=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 6E0F8C433E5 for ; Mon, 27 Jul 2020 18:40:32 +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 3AA7920729 for ; Mon, 27 Jul 2020 18:40:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d7uzDTtS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AA7920729 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sJKDnrWyEoJgv3aY3nTRv6LnWIWH8aZW9XsEclKOosk=; b=d7uzDTtSs1X6NAP4TGlhAm67S ijqRuO/FE4F5kpe8H5T23dL0V5RQMCjXcUs549rwoH4laFvsvI/TwhszE5nc8QNeDqqkmYa4fUlxt wYLgtEENgJ2Y2fYe2myemE+EROtLuTD7CWHYQkdO4AOGQ0qZNywSptlGT2LTq9qFotmbq6Bqe2j+N LqF91vWB3+Rv1tOzakLzAGmNQoHMmu5E2/W4cTkoGQv8CR9tQYTAdMDo8mRq04YJE73AMuS+NaL7t AMtSNBGt10+XXskgs5qbkJsh018Y4OG/Ko4uBlWkUYtYu2plj3B5T+2iXpadmut0mL+/I3DFr9+vp SnuthKyjQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0834-0000ZR-E4; Mon, 27 Jul 2020 18:40:30 +0000 Received: from mail-pl1-f194.google.com ([209.85.214.194]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0832-0000Yj-9p for linux-nvme@lists.infradead.org; Mon, 27 Jul 2020 18:40:29 +0000 Received: by mail-pl1-f194.google.com with SMTP id l6so8570226plt.7 for ; Mon, 27 Jul 2020 11:40:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rC7Tk0r3xbJ5Oshs2cMtEw58Q2CIxkR3NVrOAGPz33w=; b=BILBdnN9GKdesUFI1OGCzgzsf/cDqt0tAbHcl4kJYP3E4A+2OKC2Rz1JcLuWTJsNVJ ncGi+f8IC+VQ479PApQnh42Hwc+G/JXDmjI4skrFyWEAcsI9++rvQECmcJhecfaqR5ay jloddXSkSu0Zfn7gno0WGegzte5TqmxtRCzftKLhSzp+acVuw8OZA1DTSy1+U1EACXMx jGnBHmGVthTSpMpx/hjiFjUplZPS2NMarmE7sNfc6FsyidqS2OcenDmwM0r4DSOt5zAP ZCkfMTk59kPLL5BFlRAQjEflGshn5oPAI2RGoEpGvWVApK4i7hDynrkx5y0Nei5VDWxV 45sw== X-Gm-Message-State: AOAM533ERNg0BPnsJm8l+hdjIhRBlZWQ3AJdhVirNVvIBa1YOdTYaGcv mQDt/Q7lFVYSk6czR1wqtBgyp5xG X-Google-Smtp-Source: ABdhPJw2p7qTeYU2hJoAWFP3Sk8Bc8KLs/DYH7ECspsJSzpvEL0TKMzDwu8WLSFZNDMqB2G/rUFlxg== X-Received: by 2002:a17:90a:d195:: with SMTP id fu21mr606720pjb.100.1595875226860; Mon, 27 Jul 2020 11:40:26 -0700 (PDT) Received: from ?IPv6:2601:647:4802:9070:5d7d:f206:b163:f30b? ([2601:647:4802:9070:5d7d:f206:b163:f30b]) by smtp.gmail.com with ESMTPSA id i128sm15685492pfe.74.2020.07.27.11.40.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jul 2020 11:40:26 -0700 (PDT) Subject: Re: [PATCH v3 1/2] blk-mq: add async quiesce interface To: Ming Lei , Chao Leng References: <20200726002301.145627-1-sagi@grimberg.me> <20200726002301.145627-2-sagi@grimberg.me> <20200726093132.GD1110104@T590> <9ac5f658-31b3-bb19-e5fe-385a629a7d67@grimberg.me> <20200727020803.GC1129253@T590> <20200727035033.GD1129253@T590> <79ab699e-3f50-26c0-3c85-1962ae4dedac@huawei.com> <20200727063220.GA1144698@T590> From: Sagi Grimberg Message-ID: Date: Mon, 27 Jul 2020 11:40:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200727063220.GA1144698@T590> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_144028_385913_E1B1FADD X-CRM114-Status: GOOD ( 18.58 ) 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: Keith Busch , Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , linux-nvme@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org >>>>>> It is at the end and contains exactly what is needed to synchronize. Not >>>>> The sync is simply single global synchronize_rcu(), and why bother to add >>>>> extra >=40bytes for each hctx. >>>>> >>>>>> sure what you mean by reuse hctx->srcu? >>>>> You already reuses hctx->srcu, but not see reason to add extra rcu_synchronize >>>>> to each hctx for just simulating one single synchronize_rcu(). >>>> >>>> To sync srcu together, the extra bytes must be needed, seperate blocking >>>> and non blocking queue to two hctx may be a not good choice. >>>> >>>> There is two choice: the struct rcu_synchronize is added in hctx or in srcu. >>>> Though add rcu_synchronize in srcu has a weakness: the extra bytes is >>>> not need if which do not need batch sync srcu, I still think it's better >>>> for the SRCU to provide the batch synchronization interface. >>> >>> The 'struct rcu_synchronize' can be allocated from heap or even stack( >>> if no too many NSs), which is just one shot sync and the API is supposed >>> to be called in slow path. No need to allocate it as long lifetime variable. >>> Especially 'struct srcu_struct' has already been too fat. >> >> Stack is not suitable, stack can not provide so many space for > > Stack is fine if number of NS is small, for example, most of times, > there is just one NS. I prefer a single code-path, so stack is not good. >> many name space. Heap maybe a choice, but need to add abnormal treat >> when alloc memory failed, Thus io pause time can not be ensured. >> So the extra space may must be needed for batch srcu sync. > > In case of allocation failure, you can switch to synchronize_srcu() simply. that is possible, but I still prefer to support both srcu and rcu hctx in a single interface so I don't need to have different code paths in nvme (or other drivers). _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme