summary refs log tree commit diff
path: root/fs/nfs/internal.h
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-11-19 10:54:55 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-12-02 11:42:50 -0500
commit79f687a3de9e3ba2518b4ea33f38ca6cbe9133eb (patch)
treec15b378ef1a550bccaa89100f26fcb76f9196b93 /fs/nfs/internal.h
parentf36ab161bebe464d33b998294eff29b17a9c8918 (diff)
downloadlinux-79f687a3de9e3ba2518b4ea33f38ca6cbe9133eb.tar.gz
NFS: Fix a performance regression in readdir
Ben Coddington reports that commit 311324ad1713, by adding the function
nfs_dir_mapping_need_revalidate() that checks page cache validity on
each call to nfs_readdir() causes a performance regression when
the directory is being modified.

If the directory is changing while we're iterating through the directory,
POSIX does not require us to invalidate the page cache unless the user
calls rewinddir(). However, we still do want to ensure that we use
readdirplus in order to avoid a load of stat() calls when the user
is doing an 'ls -l' workload.

The fix should be to invalidate the page cache immediately when we're
setting the NFS_INO_ADVISE_RDPLUS bit.

Reported-by: Benjamin Coddington <bcodding@redhat.com>
Fixes: 311324ad1713 ("NFS: Be more aggressive in using readdirplus...")
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/internal.h')
0 files changed, 0 insertions, 0 deletions