linux/fs/nfs
Mike Snitzer 867da60d46 nfs: avoid i_lock contention in nfs_clear_invalid_mapping
Multi-threaded buffered reads to the same file exposed significant
inode spinlock contention in nfs_clear_invalid_mapping().

Eliminate this spinlock contention by checking flags without locking,
instead using smp_rmb and smp_load_acquire accordingly, but then take
spinlock and double-check these inode flags.

Also refactor nfs_set_cache_invalid() slightly to use
smp_store_release() to pair with nfs_clear_invalid_mapping()'s
smp_load_acquire().

While this fix is beneficial for all multi-threaded buffered reads
issued by an NFS client, this issue was identified in the context of
surprisingly low LOCALIO performance with 4K multi-threaded buffered
read IO.  This fix dramatically speeds up LOCALIO performance:

before: read: IOPS=1583k, BW=6182MiB/s (6482MB/s)(121GiB/20002msec)
after:  read: IOPS=3046k, BW=11.6GiB/s (12.5GB/s)(232GiB/20001msec)

Fixes: 17dfeb9113 ("NFS: Fix races in nfs_revalidate_mapping")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2024-11-04 10:24:19 -05:00
..
blocklayout
filelayout
flexfilelayout
cache_lib.c
cache_lib.h
callback_proc.c
callback_xdr.c
callback.c
callback.h
client.c nfs_common: fix localio to cope with racing nfs_local_probe() 2024-11-04 10:24:19 -05:00
delegation.c
delegation.h
dir.c
direct.c
dns_resolve.c
dns_resolve.h
export.c
file.c
fs_context.c
fscache.c
fscache.h
getroot.c
inode.c nfs: avoid i_lock contention in nfs_clear_invalid_mapping 2024-11-04 10:24:19 -05:00
internal.h
io.c
iostat.h
Kconfig
localio.c nfs_common: fix localio to cope with racing nfs_local_probe() 2024-11-04 10:24:19 -05:00
Makefile
mount_clnt.c
namespace.c
netns.h
nfs2super.c
nfs2xdr.c
nfs3_fs.h
nfs3acl.c
nfs3client.c
nfs3proc.c
nfs3super.c
nfs3xdr.c
nfs4_fs.h
nfs4client.c
nfs4file.c
nfs4getroot.c
nfs4idmap.c
nfs4idmap.h
nfs4namespace.c
nfs4proc.c NFS: Fix attribute delegation behaviour on exclusive create 2024-11-04 10:24:19 -05:00
nfs4renewd.c
nfs4session.c
nfs4session.h
nfs4state.c
nfs4super.c
nfs4sysctl.c
nfs4trace.c
nfs4trace.h
nfs4xdr.c
nfs42.h
nfs42proc.c
nfs42xattr.c
nfs42xdr.c
nfs.h
nfsroot.c
nfstrace.c
nfstrace.h
pagelist.c
pnfs_dev.c
pnfs_nfs.c
pnfs.c
pnfs.h
proc.c
read.c
super.c NFSv3: only use NFS timeout for MOUNT when protocols are compatible 2024-11-04 10:24:18 -05:00
symlink.c
sysctl.c
sysfs.c
sysfs.h
unlink.c
write.c