linux/fs/nfs
Benjamin Coddington 27934d02cb NFS: Charge unstable writes by request size, not folio size
nfs_folio_mark_unstable() and nfs_folio_clear_commit() charge and
uncharge NR_WRITEBACK/WB_WRITEBACK by folio_nr_pages(folio) once per
*request* added to or removed from a commit list. This is correct only
when a folio has a single associated request. When pg_test splits a
folio into N sub-folio requests (e.g. pNFS flexfiles striping with a
stripe unit smaller than the folio size, or plain wsize-limited
splitting), each of the N requests independently charges the whole
folio's page count, inflating the accounting by a factor of N per
folio. With large folios and small stripe units this reaches multiple
orders of magnitude: a 2 MiB folio split into 512 4 KiB requests can
charge up to 512x its real size, pushing global dirty+writeback
accounting past the system's dirty threshold and forcing every
buffered writer on the host into the hard-throttle path, including
unrelated in-kernel NFS server threads sharing the box.

Charge each request only for the pages it actually covers.

Fixes: 0c493b5cf1 ("NFS: Convert buffered writes to use folios")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
2026-07-08 14:43:40 -04:00
..
blocklayout NFS client updates for Linux 7.1 2026-04-24 14:20:03 -07:00
filelayout pNFS/filelayout: fix cheking if a layout is striped 2026-06-08 10:21:55 -04:00
flexfilelayout NFSv4/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS in pg_get_mirror_count_write 2026-06-08 12:06:41 -04:00
cache_lib.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cache_lib.h
callback_proc.c NFSv4/pnfs: defer return_range callbacks until after inode unlock 2026-06-08 10:21:56 -04:00
callback_xdr.c nfs: use memcpy_and_pad in decode_fh 2026-04-22 08:53:23 -04:00
callback.c NFS Client Updates for Linux 7.0 2026-02-12 17:49:33 -08:00
callback.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
client.c NFS Client Updates for Linux 7.2 2026-06-23 18:36:41 -07:00
delegation.c nfs: use nfsi->rwsem to protect traversal of the file lock list 2026-06-08 15:04:21 -04:00
delegation.h NFS: fix delayed delegation return handling 2026-01-30 16:49:15 -05:00
dir.c NFSv4: include MAY_WRITE in open permission mask for O_TRUNC 2026-07-08 14:42:02 -04:00
direct.c nfs: expose FMODE_NOWAIT for read-only files 2026-06-08 12:07:16 -04:00
dns_resolve.c sunrpc: rename sunrpc_cache_pipe_upcall_timeout() 2026-06-01 11:08:18 -04:00
dns_resolve.h
export.c nfs: replace NFS_FILEID() and nfsi->fileid with inode->i_ino 2026-06-08 10:21:54 -04:00
file.c nfs: expose FMODE_NOWAIT for read-only files 2026-06-08 12:07:16 -04:00
fs_context.c vfs: add FS_USERNS_DELEGATABLE flag and set it for NFS 2026-06-09 17:17:29 +02:00
fscache.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
fscache.h netfs: Drop the was_async arg from netfs_read_subreq_terminated() 2024-12-20 22:34:03 +01:00
getroot.c nfs: get rid of fake root dentries 2026-06-05 00:34:56 -04:00
inode.c NFS Client Updates for Linux 7.2 2026-06-23 18:36:41 -07:00
internal.h NFS: Charge unstable writes by request size, not folio size 2026-07-08 14:43:40 -04:00
io.c nfs: add nowait version of nfs_start_io_direct 2026-06-08 12:07:16 -04:00
iostat.h
Kconfig NFS: Fix NFS KConfig typos 2026-02-27 15:42:14 -05:00
localio.c NFS: fix writeback in presence of errors 2026-04-22 08:53:23 -04:00
Makefile NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
mount_clnt.c NFS: Remove unused function nfs_umount 2025-07-14 15:20:28 -07:00
namespace.c nfs: Implement fileattr_get for case sensitivity 2026-05-11 16:50:29 +02:00
netns.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs.h
nfs2super.c
nfs2xdr.c nfs/localio: add tracepoints for misaligned DIO READ and WRITE support 2025-09-30 16:10:30 -04:00
nfs3_fs.h
nfs3acl.c nfs: nfs3acl: drop useless assignment in nfs3_get_acl() 2025-04-27 23:25:44 -04:00
nfs3client.c pnfs: Set transport security policy to RPC_XPRTSEC_NONE unless using TLS 2025-11-10 10:32:28 -05:00
nfs3proc.c nfs: Implement fileattr_get for case sensitivity 2026-05-11 16:50:29 +02:00
nfs3super.c
nfs3xdr.c nfs: Implement fileattr_get for case sensitivity 2026-05-11 16:50:29 +02:00
nfs4_fs.h NFSv4: pass lease period in seconds to nfs4_set_lease_period() 2026-02-09 13:39:39 -05:00
nfs4client.c NFSv4.1: Apply session size limits on clone path 2026-04-13 14:56:09 -07:00
nfs4file.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4getroot.c NFSv4: Remove duplicate lookups, capability probes and fsinfo calls 2025-08-04 09:48:16 -07:00
nfs4idmap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4idmap.h
nfs4namespace.c NFS: remove unused page and page2 in nfs4_replace_transport() 2026-05-27 15:12:23 +02:00
nfs4proc.c NFS Client Updates for Linux 7.2 2026-06-23 18:36:41 -07:00
nfs4renewd.c NFSv4: limit lease period in nfs4_set_lease_period() 2026-02-09 13:39:39 -05:00
nfs4session.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
nfs4session.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs4state.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4super.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs4sysctl.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
nfs4trace.c NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs4trace.h nfs: replace NFS_FILEID() and nfsi->fileid with inode->i_ino 2026-06-08 10:21:54 -04:00
nfs4xdr.c NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
nfs40.h NFS: Move NFS v4.0 pathdown recovery into nfs40client.c 2026-01-30 11:42:20 -05:00
nfs40client.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
nfs40proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nfs42.h NFS: Add support for fallocate(FALLOC_FL_ZERO_RANGE) 2025-05-28 17:17:13 -04:00
nfs42proc.c NFS: fix eof updates after NFSv4.2 fallocate/zero-range 2026-06-08 10:21:55 -04:00
nfs42xattr.c
nfs42xdr.c nfs: update inode ctime after removexattr operation 2026-04-13 11:46:08 -07:00
nfsroot.c
nfstrace.c
nfstrace.h nfs: replace NFS_FILEID() and nfsi->fileid with inode->i_ino 2026-06-08 10:21:54 -04:00
pagelist.c nfs: replace NFS_FILEID() and nfsi->fileid with inode->i_ino 2026-06-08 10:21:54 -04:00
pnfs_dev.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pnfs_nfs.c NFS: Charge unstable writes by request size, not folio size 2026-07-08 14:43:40 -04:00
pnfs.c NFSv4/pnfs: defer return_range callbacks until after inode unlock 2026-06-08 10:21:56 -04:00
pnfs.h NFS: Merge CONFIG_NFS_V4_1 with CONFIG_NFS_V4 2026-01-30 11:42:21 -05:00
proc.c nfs: Implement fileattr_get for case sensitivity 2026-05-11 16:50:29 +02:00
read.c nfs: keep PG_UPTODATE clear after read errors in page groups 2026-06-08 12:06:41 -04:00
super.c NFS Client Updates for Linux 7.2 2026-06-23 18:36:41 -07:00
symlink.c nfs: Implement fileattr_get for case sensitivity 2026-05-11 16:50:29 +02:00
sysctl.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
sysfs.c NFSD 7.1 Release Notes 2026-04-20 10:44:02 -07:00
sysfs.h
unlink.c NFS Client Updates for Linux 7.2 2026-06-23 18:36:41 -07:00
write.c NFS: Charge unstable writes by request size, not folio size 2026-07-08 14:43:40 -04:00