diff options
author | 2024-10-18 17:15:41 -0400 | |
---|---|---|
committer | 2024-11-04 10:24:19 -0500 | |
commit | 867da60d463bb2a3e28c9235c487e56e96cffa00 (patch) | |
tree | 2a4dac9fb4a8478814cbf0ec5df6e4de750c1544 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | nfs_common: fix localio to cope with racing nfs_local_probe() (diff) | |
download | wireguard-linux-867da60d463bb2a3e28c9235c487e56e96cffa00.tar.xz wireguard-linux-867da60d463bb2a3e28c9235c487e56e96cffa00.zip |
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: 17dfeb911339 ("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>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions