Re: [PATCH v2] NFSD: Add io_cache_{read,write} controls to debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 06, 2025 at 05:25:11PM -0400, Chuck Lever wrote:
> From: Mike Snitzer <snitzer@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> ---
>  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




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux