From: Jeff Layton <jlayton@kernel.org>
To: Mike Snitzer <snitzer@kernel.org>
Cc: Chuck Lever <chuck.lever@oracle.com>,
linux-nfs@vger.kernel.org, Neil Brown <neilb@suse.de>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
axboe@kernel.dk
Subject: Re: nfsd: add the ability to enable use of RWF_DONTCACHE for all nfsd IO
Date: Fri, 21 Feb 2025 10:42:19 -0500 [thread overview]
Message-ID: <a8485604f64de456269f56793403c4f91a04a010.camel@kernel.org> (raw)
In-Reply-To: <Z7idYDSHD_hcLL9b@kernel.org>
On Fri, 2025-02-21 at 10:36 -0500, Mike Snitzer wrote:
> On Fri, Feb 21, 2025 at 10:25:03AM -0500, Jeff Layton wrote:
> > On Fri, 2025-02-21 at 10:02 -0500, Mike Snitzer wrote:
> > > On Thu, Feb 20, 2025 at 01:17:42PM -0500, Chuck Lever wrote:
> > > > [ Adding NFSD reviewers ... ]
> > > >
> > > > On 2/20/25 12:12 PM, Mike Snitzer wrote:
> > > > > Add nfsd 'nfsd_dontcache' modparam so that "Any data read or written
> > > > > by nfsd will be removed from the page cache upon completion."
> > > > >
> > > > > nfsd_dontcache is disabled by default. It may be enabled with:
> > > > > echo Y > /sys/module/nfsd/parameters/nfsd_dontcache
> > > >
> > > > A per-export setting like an export option would be nicer. Also, does
> > > > it make sense to make it a separate control for READ and one for WRITE?
> > > > My trick knee suggests caching read results is still going to add
> > > > significant value, but write, not so much.
> > >
> > > My intent was to make 6.14's DONTCACHE feature able to be tested in
> > > the context of nfsd in a no-frills way. I realize adding the
> > > nfsd_dontcache knob skews toward too raw, lacks polish. But I'm
> > > inclined to expose such course-grained opt-in knobs to encourage
> > > others' discovery (and answers to some of the questions you pose
> > > below). I also hope to enlist all NFSD reviewers' help in
> > > categorizing/documenting where DONTCACHE helps/hurts. ;)
> > >
> > > And I agree that ultimately per-export control is needed. I'll take
> > > the time to implement that, hopeful to have something more suitable in
> > > time for LSF.
> > >
> >
> > Would it make more sense to hook DONTCACHE up to the IO_ADVISE
> > operation in RFC7862? IO_ADVISE4_NOREUSE sounds like it has similar
> > meaning? That would give the clients a way to do this on a per-open
> > basis.
>
> Just thinking aloud here but: Using a DONTCACHE scalpel on a per open
> basis quite likely wouldn't provide the required page reclaim relief
> if the server is being hammered with normal buffered IO. Sure that
> particular DONTCACHE IO wouldn't contribute to the problem but it
> would still be impacted by those not opting to use DONTCACHE on entry
> to the server due to needing pages for its DONTCACHE buffered IO.
>
Actually, now that I read the spec, it looks like you could just embed
an IO_ADVISE operation in the read compound:
PUTFH + IO_ADVISE(for the range that you're reading) + READ() operation
That said, that does nothing for v3 reads, which I imagine you're
interested in hooking up here too.
> > > > However, to add any such administrative control, I'd like to see some
> > > > performance numbers. I think we need to enumerate the cases (I/O types)
> > > > that are most interesting to examine: small memory NFS servers; lots of
> > > > small unaligned I/O; server-side CPU per byte; storage interrupt rates;
> > > > any others?
> > > >
> > > > And let's see some user/admin documentation (eg when should this setting
> > > > be enabled? when would it be contra-indicated?)
> > > >
> > > > The same arguments that applied to Cedric's request to make maximum RPC
> > > > size a tunable setting apply here. Do we want to carry a manual setting
> > > > for this mechanism for a long time, or do we expect that the setting can
> > > > become automatic/uninteresting after a period of experimentation?
> > > >
> > > > * It might be argued that putting these experimental tunables under /sys
> > > > eliminates the support longevity question, since there aren't strict
> > > > rules about removing files under /sys.
> >
> > Isn't /sys covered by the same ABI guarantees? I know debugfs isn't,
> > but I'm not sure about /sys.
>
> Only if you add them to the ABI docs as supported (at least that is my
> experience relative to various block limits knobs, etc). But yeah,
> invariably that invites a cat and mouse game of users using the knob
> and then complaining loudly if/when it goes away.
>
> Mike
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2025-02-21 15:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 17:12 [PATCH] nfsd: add the ability to enable use of RWF_DONTCACHE for all nfsd IO Mike Snitzer
2025-02-20 18:17 ` Chuck Lever
2025-02-21 15:02 ` Mike Snitzer
2025-02-21 15:25 ` Jeff Layton
2025-02-21 15:36 ` Mike Snitzer
2025-02-21 15:42 ` Jeff Layton [this message]
2025-02-21 15:46 ` Chuck Lever
2025-02-21 16:13 ` Trond Myklebust
2025-02-21 18:42 ` Jeff Layton
2025-02-21 19:18 ` Trond Myklebust
2025-02-21 15:39 ` Chuck Lever
2025-02-21 15:46 ` Jeff Layton
2025-02-21 15:50 ` Chuck Lever
2025-02-20 19:00 ` [PATCH] " Jeff Layton
2025-02-20 19:15 ` Chuck Lever
2025-02-21 15:25 ` 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=a8485604f64de456269f56793403c4f91a04a010.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=axboe@kernel.dk \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=okorniev@redhat.com \
--cc=snitzer@kernel.org \
--cc=tom@talpey.com \
/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