public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "neilb@suse.de" <neilb@suse.de>,
	"chuck.lever@oracle.com" <chuck.lever@oracle.com>
Cc: "anna@kernel.org" <anna@kernel.org>,
	"snitzer@kernel.org" <snitzer@kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"jlayton@kernel.org" <jlayton@kernel.org>
Subject: Re: [PATCH] nfsd/filecache: add nfsd_file_acquire_gc_cached
Date: Fri, 25 Oct 2024 13:31:47 +0000	[thread overview]
Message-ID: <2ca444702fe535a04adb26df41a9ae2b904fc260.camel@hammerspace.com> (raw)
In-Reply-To: <4EDD901C-1CB9-4F99-A35C-3FCBE6F115B6@oracle.com>

On Fri, 2024-10-25 at 12:52 +0000, Chuck Lever III wrote:
> 
> 
> > On Oct 24, 2024, at 11:00 PM, NeilBrown <neilb@suse.de> wrote:
> > 
> > I'm wondering about the request for a garbage-collected nfsd_file
> > though.  For NFSv3 that makes sense.  For NFSv4 we would expect the
> > file
> > to already be open as a non-garbage-collected nfsd_file and opening
> > it
> > again seems wasteful.  That doesn't need to be fixed for this patch
> > and
> > maybe doesn't need to be fixed at all, but it seemed worth
> > highlighting.
> 
> I don't think using a GC'd nfsd_file for LOCALIO is a bug.
> 
> NFSv4 guarantees an OPEN to pin the nfsd_file, and a CLOSE
> (or lease expiry) to release it. There's no desire for or
> need for garbage collection.
> 
> NFSv3 and LOCALIO use each nfsd_file for the life of one I/O
> operation, and that nfsd_file is cached in the expectation
> that another I/O operation on the same file will happen with
> frequent temporarl proximity. Garbage collection is needed
> for both cases.
> 

No. There is a huge difference between the two. In the case of NFSv3,
the server has no idea whether or not there is further need for the
file (stateless), whereas in the localio case, the client is able to
tell exactly when the application holds the file open or not
(stateful).

The only reason for jumping through all these hoops in the case of
localio is the 'user may want to unmount' exception.

Is there any reason why we couldn't add a notification for that, to
give knfsd the opportunity to clear out any open file state? The
current approach appears to be flat out optimising for the exception.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  reply	other threads:[~2024-10-25 13:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 18:55 [PATCH] nfsd/filecache: add nfsd_file_acquire_gc_cached Mike Snitzer
2024-10-25  3:00 ` NeilBrown
2024-10-25 12:52   ` Chuck Lever III
2024-10-25 13:31     ` Trond Myklebust [this message]
2024-10-25 13:51       ` Chuck Lever III
2024-10-25 14:00       ` Jeff Layton
2024-10-27 21:49         ` NeilBrown
2024-10-25 14:21   ` Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ca444702fe535a04adb26df41a9ae2b904fc260.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox