Commit 82749dd4 authored by Trond Myklebust's avatar Trond Myklebust

NFS: Reduce lock contention in nfs_page_find_head_request()

Add a lockless check for whether or not the page might be carrying
an existing writeback before we grab the inode->i_lock.
Reported-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 6d17d653
......@@ -190,9 +190,11 @@ static struct nfs_page *nfs_page_find_head_request(struct page *page)
struct inode *inode = page_file_mapping(page)->host;
struct nfs_page *req = NULL;
if (PagePrivate(page) || PageSwapCache(page)) {
spin_lock(&inode->i_lock);
req = nfs_page_find_head_request_locked(NFS_I(inode), page);
spin_unlock(&inode->i_lock);
}
return req;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment