NFS: Adjust the amount of readahead performed by NFS readdir
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 7 Feb 2022 18:37:00 +0000 (13:37 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Mar 2022 13:43:38 +0000 (08:43 -0500)
commit580f236737d13ee25d5b0b1d124f50014fe6833b
treed139d59e0826080269b22b243829a6e298c3a62c
parentc8f0523ba398b72ffdb6e41930c089b75a6e2acf
NFS: Adjust the amount of readahead performed by NFS readdir

The current NFS readdir code will always try to maximise the amount of
readahead it performs on the assumption that we can cache anything that
isn't immediately read by the process.
There are several cases where this assumption breaks down, including
when the 'ls -l' heuristic kicks in to try to force use of readdirplus
as a batch replacement for lookup/getattr.

This patch therefore tries to tone down the amount of readahead we
perform, and adjust it to try to match the amount of data being
requested by user space.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/dir.c
include/linux/nfs_fs.h