Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5881302ioo; Wed, 1 Jun 2022 14:53:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzup/ccBiobChBw0EDVFWydU8BK/rG6S79pBQRTeXLKpbZ3+KEFDzY1rq6v0y+I5eRPsox X-Received: by 2002:a63:86c6:0:b0:3fc:68a8:2429 with SMTP id x189-20020a6386c6000000b003fc68a82429mr1264525pgd.5.1654120413321; Wed, 01 Jun 2022 14:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654120413; cv=none; d=google.com; s=arc-20160816; b=UzN0tYTUiwFxIEbgK1NBCzbapM1y1y7QpNEOVayNvl14U6uqNd8Womd3cQZhLgJkHt E18VT7SlSLPfWvz9+a594o8fOc4yA/WOdNCAxD175xA4wedFGzTW10a3ysLQhDObWSVW wjhVIcgsyfNBveSmv6/XM8rVYh51sY6bnKVyKnE4BiIAVwMILyMNk2JkajO2E+EVyPmz WUKjDV3o6X44rYUHbYTBccKCi5MhWDAhLJcVMIIbFfeHw8ETRQG2My2yA6D2biXISOtD iGHVzZV/XQ15NC3eOZn30YBNlDqGUimT6i+IZ4yGcKN3EcGrRWu8zjos5G2OAV59F29J pyGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:cc:to:from:date:subject :dkim-signature; bh=013QbhyOZ9F4GGJuL3++6SFm7vOde6EWva7Trl/18es=; b=q9MSmiFOUPYaTgQO4MP6HZOxqHTiOhgLkdnBQgo6GgGJo0BksV/tuy2oIWL7ZfRoPv KCzmH45ywGDuKTSpJEZYrmHANVAjQA7iOTC+qOy1ozciQEYvQc1dd96NUpKzti9Qd6mU vTpZTzYr2Mqh5RjmKGTd3SaRvw36jmMMCTHu9CAbvkUWkekMbR0kcKEtL+PfaGmc8xYb Pw3QqChOXTkIApkmavSPxivScX4VdmMnGuyoi0reH82sRNEEIaxLw3uCkqhT7H2y9Znu FTfnAua5edKDiVn2ln6W9HXMRpySwv6LvzpliOHlwiU1rsfaKQSCizTBRMTkqpLUJ3tb Ys6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="M9ekQ/0+"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b24-20020a631b58000000b003fae815a762si3719283pgm.226.2022.06.01.14.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:53:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="M9ekQ/0+"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E11D6CF69; Wed, 1 Jun 2022 14:18:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231292AbiFAVSd (ORCPT + 99 others); Wed, 1 Jun 2022 17:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbiFAVSc (ORCPT ); Wed, 1 Jun 2022 17:18:32 -0400 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 527926CA9F for ; Wed, 1 Jun 2022 14:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1654118312; x=1685654312; h=date:from:to:cc:message-id:references:mime-version: in-reply-to:subject; bh=013QbhyOZ9F4GGJuL3++6SFm7vOde6EWva7Trl/18es=; b=M9ekQ/0+vqNlmdx3++0/mk+SnaXubbya9I3eGEYyf8Py23KTgoT62S+5 vkaXX4yDOB8FV7gCrg70/5+19oYiFF1zLJMCEsXH9IdxiP1aJjkcL5IQw 4cNC1IZ411b/6Nuc21hP01vZg7ZIZIe1arIloH4DK7nWFAXGQ7apzBnQM o=; X-IronPort-AV: E=Sophos;i="5.91,269,1647302400"; d="scan'208";a="207190006" Subject: Re: filecache LRU performance regression Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-8be8ed69.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP; 01 Jun 2022 21:18:31 +0000 Received: from EX13MTAUEE002.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1e-8be8ed69.us-east-1.amazon.com (Postfix) with ESMTPS id 519CFC095E; Wed, 1 Jun 2022 21:18:29 +0000 (UTC) Received: from EX13D05UEE001.ant.amazon.com (10.43.62.120) by EX13MTAUEE002.ant.amazon.com (10.43.62.24) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Wed, 1 Jun 2022 21:18:28 +0000 Received: from EX13MTAUEE002.ant.amazon.com (10.43.62.24) by EX13D05UEE001.ant.amazon.com (10.43.62.120) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Wed, 1 Jun 2022 21:18:28 +0000 Received: from dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com (172.19.206.175) by mail-relay.amazon.com (10.43.62.224) with Microsoft SMTP Server id 15.0.1497.36 via Frontend Transport; Wed, 1 Jun 2022 21:18:28 +0000 Received: by dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com (Postfix, from userid 6262777) id 302ECF5; Wed, 1 Jun 2022 21:18:27 +0000 (UTC) Date: Wed, 1 Jun 2022 21:18:27 +0000 From: Frank van der Linden To: Chuck Lever III CC: Wang Yugui , Linux NFS Mailing List , Matthew Wilcox , "Liam Howlett" Message-ID: <20220601211827.GA11605@dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com> References: <5C7024DA-A792-4091-BFDE-CEED59BC1B69@oracle.com> <20220527203721.GA10628@dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com> <20220601161003.GA20483@dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com> <4C14DB3A-A5C1-41A9-8293-DF4FC2459600@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4C14DB3A-A5C1-41A9-8293-DF4FC2459600@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Jun 01, 2022 at 04:37:47PM +0000, Chuck Lever III wrote: > > > On Jun 1, 2022, at 12:10 PM, Frank van der Linden wrote: > > > > On Wed, Jun 01, 2022 at 12:34:34AM +0000, Chuck Lever III wrote: > >>> On May 27, 2022, at 5:34 PM, Chuck Lever III wrote: > >>> > >>> > >>> > >>>> On May 27, 2022, at 4:37 PM, Frank van der Linden wrote: > >>>> > >>>> On Fri, May 27, 2022 at 06:59:47PM +0000, Chuck Lever III wrote: > >>>>> > >>>>> > >>>>> Hi Frank- > >>>>> > >>>>> Bruce recently reminded me about this issue. Is there a bugzilla somewhere? > >>>>> Do you have a reproducer I can try? > >>>> > >>>> Hi Chuck, > >>>> > >>>> The easiest way to reproduce the issue is to run generic/531 over an > >>>> NFSv4 mount, using a system with a larger number of CPUs on the client > >>>> side (or just scaling the test up manually - it has a calculation based > >>>> on the number of CPUs). > >>>> > >>>> The test will take a long time to finish. I initially described the > >>>> details here: > >>>> > >>>> https://lore.kernel.org/linux-nfs/20200608192122.GA19171@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com/ > >>>> > >>>> Since then, it was also reported here: > >>>> > >>>> https://lore.kernel.org/all/20210531125948.2D37.409509F4@e16-tech.com/T/#m8c3e4173696e17a9d5903d2a619550f352314d20 > >>> > >>> Thanks for the summary. So, there isn't a bugzilla tracking this > >>> issue? If not, please create one here: > >>> > >>> https://bugzilla.linux-nfs.org/ > >>> > >>> Then we don't have to keep asking for a repeat summary ;-) > >> > >> I can easily reproduce this scenario in my lab. I've opened: > >> > >> https://bugzilla.linux-nfs.org/show_bug.cgi?id=386 > >> > > > > Thanks for taking care of that. I'm switching jobs, so I won't have much > > time to look at it or test for a few weeks. > > No problem. I can reproduce the failure, and I have some ideas > of how to address the issue, so I've assigned the bug to myself. > > > > I think the basic problem is that the filecache is a clear win for > > v3, since that's stateless and it avoids a lookup for each operation. > > > > For v4, it's not clear to me that it's much of a win, and in this case > > it definitely gets in the way. > > > > Maybe the best thing is to not bother at all with the caching for v4, > > At this point I don't think we can go that way. The NFSv4 code > uses a lot of the same infrastructural helpers as NFSv3, and > all of those now depend on the use of nfsd_file objects. > > Certainly, though, the filecache plays somewhat different roles > for legacy NFS and NFSv4. I've been toying with the idea of > maintaining separate filecaches for NFSv3 and NFSv4, since > the garbage collection and shrinker rules are fundamentally > different for the two, and NFSv4 wants a file closed completely > (no lingering open) when it does a CLOSE or DELEGRETURN. > > In the meantime, the obvious culprit is the LRU walk during > garbage collection is broken. I've talked with Dave Chinner, > co-author of list_lru, about a way to straighten this out so > that the LRU walk is very nicely bounded and at the same time > deals properly with NFSv4 OPEN and CLOSE. Trond also had an > idea or two here, and it seems the three of us are on nearly > the same page. > > Once that is addressed, we can revisit Wang's suggestion of > serializing garbage collection, as a nice optimization. Sounds good, thanks! A related issue: there is currently no upper limit that I can see on the number of active OPENs for a client. So essentially, a client can run a server out of resources by doing a very large number of OPENs. Should there be an upper limit, above which requests are either denied, or old state is invalidated? - Frank