]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Fix a performance regression in readdir
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 19 Nov 2016 15:54:55 +0000 (10:54 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 2 Dec 2016 16:42:50 +0000 (11:42 -0500)
commitfda2b7b5bc9b2eb2dc7c078cf35e28c47f23a326
treec15b378ef1a550bccaa89100f26fcb76f9196b93
parentaa7ec69434c917c333c44b10b0ec3f1bdff4b985
NFS: Fix a performance regression in readdir

Ben Coddington reports that commit 22d025e86d91, 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: 22d025e86d91 ("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>
fs/nfs/dir.c