All of lore.kernel.org
 help / color / mirror / Atom feed
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, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: NFSD: Add io_cache_{read,write} controls to debugfs
Date: Fri, 5 Sep 2025 13:32:13 -0400	[thread overview]
Message-ID: <aLseneIE3Mubr5uV@kernel.org> (raw)
In-Reply-To: <20250905145509.8678-1-cel@kernel.org>

On Fri, Sep 05, 2025 at 10:55:09AM -0400, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>

Aside from attribution, which I suspect you didn't intend to switch
these changes from being attributed to me, this looks good (one small
nit below).

> 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.
> 
> If NFSD_IO_DONTCACHE is specified, all exported filesystems must
> implement FOP_DONTCACHE, otherwise IO flagged with RWF_DONTCACHE
> will fail with -EOPNOTSUPP.
> 
> 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     | 19 ++++++++++
>  3 files changed, 121 insertions(+)
> 
> Changes from Mike's v9:
> - Squashed the "io controls" patches together
> - Removed NFSD_IO_DIRECT for the moment
> - Addressed a few more checkpatch.pl nits
> 
> This gives a cleaner platform on which to build the direct I/O code
> paths, and does not expose partially implemented I/O modes to users.
>
> diff --git a/fs/nfsd/debugfs.c b/fs/nfsd/debugfs.c
> index 84b0c8b559dc..2b1bb716b608 100644
> --- a/fs/nfsd/debugfs.c
> +++ b/fs/nfsd/debugfs.c
> @@ -44,4 +131,10 @@ void nfsd_debugfs_init(void)
>  
>  	debugfs_create_file("disable-splice-read", S_IWUSR | S_IRUGO,
>  			    nfsd_top_dir, NULL, &nfsd_dsr_fops);
> +
> +	debugfs_create_file("io_cache_read", 0644, nfsd_top_dir, NULL,
> +			    &nfsd_io_cache_read_fops);
> +
> +	debugfs_create_file("io_cache_write", 0644, nfsd_top_dir, NULL,
> +			    &nfsd_io_cache_write_fops);
>  }

Relative to checkpatch warnings, this ^ code is what I'm aware of.
For consistency I stuck with "S_IWUSR | S_IRUG", whereas you honored
checkpatch's suggestion to use 0644.

Maybe update disable-splice-read to also use 0644 too? But your call!

Thanks,
Mike

  reply	other threads:[~2025-09-05 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 14:55 [PATCH] NFSD: Add io_cache_{read,write} controls to debugfs Chuck Lever
2025-09-05 17:32 ` Mike Snitzer [this message]
2025-09-05 18:45   ` Chuck Lever
2025-09-05 19:15     ` 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=aLseneIE3Mubr5uV@kernel.org \
    --to=snitzer@kernel.org \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.