Skip to content

Commit 4f52b6b

Browse files
committed
NFS: Don't call COMMIT in ->releasepage()
While COMMIT has the potential to free up a lot of memory that is being taken by unstable writes, it isn't guaranteed to free up this particular page. Also, calling fsync() on the server is expensive and so we want to do it in a more controlled fashion, rather than have it triggered at random by the VM. Signed-off-by: Trond Myklebust <[email protected]>
1 parent 93761d9 commit 4f52b6b

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

fs/nfs/file.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -460,31 +460,8 @@ static void nfs_invalidate_page(struct page *page, unsigned int offset,
460460
*/
461461
static int nfs_release_page(struct page *page, gfp_t gfp)
462462
{
463-
struct address_space *mapping = page->mapping;
464-
465463
dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
466464

467-
/* Always try to initiate a 'commit' if relevant, but only
468-
* wait for it if the caller allows blocking. Even then,
469-
* only wait 1 second and only if the 'bdi' is not congested.
470-
* Waiting indefinitely can cause deadlocks when the NFS
471-
* server is on this machine, when a new TCP connection is
472-
* needed and in other rare cases. There is no particular
473-
* need to wait extensively here. A short wait has the
474-
* benefit that someone else can worry about the freezer.
475-
*/
476-
if (mapping) {
477-
struct nfs_server *nfss = NFS_SERVER(mapping->host);
478-
nfs_commit_inode(mapping->host, 0);
479-
if (gfpflags_allow_blocking(gfp) &&
480-
!bdi_write_congested(&nfss->backing_dev_info)) {
481-
wait_on_page_bit_killable_timeout(page, PG_private,
482-
HZ);
483-
if (PagePrivate(page))
484-
set_bdi_congested(&nfss->backing_dev_info,
485-
BLK_RW_ASYNC);
486-
}
487-
}
488465
/* If PagePrivate() is set, then the page is not freeable */
489466
if (PagePrivate(page))
490467
return 0;

0 commit comments

Comments
 (0)