Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp889759ybv; Fri, 7 Feb 2020 10:19:40 -0800 (PST) X-Google-Smtp-Source: APXvYqx4CrElKZtGtdKFjpZJhMmKAxWHZZ2/7t2nB7m1fKa7X2uaZmQ8h+5A8gNH1EMpZZnZvWyg X-Received: by 2002:aca:1c1a:: with SMTP id c26mr2961153oic.75.1581099580474; Fri, 07 Feb 2020 10:19:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581099580; cv=none; d=google.com; s=arc-20160816; b=HeNAKEEAKtn1EL6w9g1FomtPWgjhQuEHoqTeElQlIJcwL/pEIEOw5qgbfe2UenLYpU o8+qrXnUOnULupbWQzcQogJQdA9OwfdRo/MenGR54YihsZNetzP7Paz7JM/YAQURSB9T WuL4dihUyBEz5Oy6RXVK+JDNLM6cIeFZmJyBeYmn1hQVPzawHLLJjx0csdQeePbHF7wF b8v2gBds3jwx7oBcDeSnPa+BRt8SWC/zgYpsbUelhExLIqDJE7gawrXCZqqgg0+YEQC2 ahwlC9SimWBGhnuygTXBKkwJctx0CsjddU13pn/ZVdDbkT25IBGHcNQAGD8UONSCGVMW Rkaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uDX4embHGL0ORMBx4EFl1Svp93lywUrY6cfpYNRN4gM=; b=jYqzi3EWYs1MdovHkOerYm5E5PD+humpFrYyUXVJAH0AqIj0O8yXBVGTGHsLTq5Rlp 3kEUR8IZyUVd7s20bSV2PxIXT/hQdIRm3SpyEG0YoGIZhBKb20zg65HCfcUGPQySc6c3 QD2rAyy3R7lsVdmPCKcY81QDcV1N6Qj1Z2ZGj64Y8ETF6BnQXZZMkK1AHfOuxVYQnhSk zI7ktdF+vW70CHVVHF/vWrGXqkX8a6WCVd/k6+IBXkrKDS9fliCbNj4gt++Z0QyjeTrk 1Ecb6gxeJSrcM1wqss+7ecT5Ia29oO0pkKZTgvUDRxdvee5tUeQPr1PABk7UTAsMXTyM EYLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si38575oto.85.2020.02.07.10.19.21; Fri, 07 Feb 2020 10:19:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbgBGSSS (ORCPT + 99 others); Fri, 7 Feb 2020 13:18:18 -0500 Received: from fieldses.org ([173.255.197.46]:56544 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727804AbgBGSSS (ORCPT ); Fri, 7 Feb 2020 13:18:18 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 698F1709; Fri, 7 Feb 2020 13:18:17 -0500 (EST) Date: Fri, 7 Feb 2020 13:18:17 -0500 From: "bfields@fieldses.org" To: Trond Myklebust Cc: "linux-nfs@vger.kernel.org" , "bfields@redhat.com" Subject: Re: [PATCH] SUNRPC/cache: Allow garbage collection of invalid cache entries Message-ID: <20200207181817.GC17036@fieldses.org> References: <20200114165738.922961-1-trond.myklebust@hammerspace.com> <20200206163322.GB2244@fieldses.org> <8dc1ed17de98e4b59fb9e408692c152456863a20.camel@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8dc1ed17de98e4b59fb9e408692c152456863a20.camel@hammerspace.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Feb 07, 2020 at 02:25:27PM +0000, Trond Myklebust wrote: > On Thu, 2020-02-06 at 11:33 -0500, J. Bruce Fields wrote: > > On Tue, Jan 14, 2020 at 11:57:38AM -0500, Trond Myklebust wrote: > > > If the cache entry never gets initialised, we want the garbage > > > collector to be able to evict it. Otherwise if the upcall daemon > > > fails to initialise the entry, we end up never expiring it. > > > > Could you tell us more about what motivated this? > > > > It's causing failures on pynfs server-reboot tests. I haven't pinned > > down the cause yet, but it looks like it could be a regression to the > > behavior Kinglong Mee describes in detail in his original patch. > > > > Can you point me to the tests that are failing? I'm basically doing ./nfs4.1/testserver.py myserver:/path reboot --serverhelper=examples/server_helper.sh --serverhelperarg=myserver For all I know at this point, the change could be exposing a pynfs-side bug. > The motivation here is to allow the garbage collector to do its job of > evicting cache entries after they are supposed to have timed out. Understood. I was curious whether this was found by code inspection or because you'd run across a case where the leak was causing a practical problem. --b. > The fact that uninitialised cache entries are given an infinite > lifetime, and are never evicted is a de facto memory leak if, for > instance, the mountd daemon ignores the cache request, or the downcall > in expkey_parse() or svc_export_parse() fails without being able to > update the request. > > The threads that are waiting for the cache replies already have a > mechanism for dealing with timeouts (with cache_wait_req() and > deferred requests), so the question is what is so special about > uninitialised requests that we have to leak them in order to avoid a > problem with reboot?