From: Mike Snitzer <snitzer@kernel.org>
To: Chuck Lever <cel@kernel.org>
Cc: NeilBrown <neil@brown.name>, Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2] NFSD: Add io_cache_{read,write} controls to debugfs
Date: Sat, 6 Sep 2025 21:16:03 -0400 [thread overview]
Message-ID: <aLzc0_bdqliymMXr@kernel.org> (raw)
In-Reply-To: <20250906212511.9139-1-cel@kernel.org>
On Sat, Sep 06, 2025 at 05:25:11PM -0400, Chuck Lever wrote:
> From: Mike Snitzer <snitzer@kernel.org>
>
> Add 'io_cache_read' to NFSD's debugfs interface so that any data
> read by NFSD will either be:
> - cached using page cache (NFSD_IO_BUFFERED=0)
> - cached but removed from the page cache upon completion
> (NFSD_IO_DONTCACHE=1).
>
> io_cache_read may be set by writing to:
> /sys/kernel/debug/nfsd/io_cache_read
>
> Add 'io_cache_write' to NFSD's debugfs interface so that any data
> written by NFSD will either be:
> - cached using page cache (NFSD_IO_BUFFERED=0)
> - cached but removed from the page cache upon completion
> (NFSD_IO_DONTCACHE=1).
>
> io_cache_write may be set by writing to:
> /sys/kernel/debug/nfsd/io_cache_write
>
> The default value for both settings is NFSD_IO_BUFFERED, which is
> NFSD's existing behavior for both read and write. Changes to these
> settings take immediate effect for all exports and NFS versions.
>
> Currently only xfs and ext4 implement RWF_DONTCACHE. For file
> systems that do not implement RWF_DONTCACHE, NFSD use only buffered
> I/O when the io_cache setting is NFSD_IO_DONTCACHE.
>
> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> fs/nfsd/debugfs.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++
> fs/nfsd/nfsd.h | 9 +++++
> fs/nfsd/vfs.c | 21 +++++++++++
> 3 files changed, 123 insertions(+)
>
> Changes since v1:
> - Corrected patch author
> - Break back to NFSD_IO_BUFFERED when exported file system does not
> support RWF_DONTCACHE
> - Smoke tested NFSD_IO_DONTCACHE with NFSv3,v4.0,v4.1 on xfs and
> tmpfs
Looks good, thanks.
Mike
next prev parent reply other threads:[~2025-09-07 1:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-06 21:25 [PATCH v2] NFSD: Add io_cache_{read,write} controls to debugfs Chuck Lever
2025-09-07 1:16 ` Mike Snitzer [this message]
2025-09-07 11:35 ` Jeff Layton
2025-09-07 16:42 ` Chuck Lever
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=aLzc0_bdqliymMXr@kernel.org \
--to=snitzer@kernel.org \
--cc=cel@kernel.org \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--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