]> git.proxmox.com Git - mirror_ubuntu-artful-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)
committerLuis Henriques <luis.henriques@canonical.com>
Fri, 20 Jan 2017 15:39:06 +0000 (15:39 +0000)
commit01ef0bc25535e5ddd87130bdcfb238e1a17629fd
treeaa30943ff8f52fb1744de93e750d3a696c6df72e
parent44ec90259c448e3ffeaaefa42a8be88c7ddbd9fd
NFS: Fix a performance regression in readdir

BugLink: http://bugs.launchpad.net/bugs/1658091
commit 79f687a3de9e3ba2518b4ea33f38ca6cbe9133eb upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
fs/nfs/dir.c