[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0806290113350.20280@blonde.site>
Date: Sun, 29 Jun 2008 01:14:30 +0100 (BST)
From: Hugh Dickins <hugh@...itas.com>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Balbir Singh <balbir@...ibm.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] memcg: shmem_getpage release page sooner
No big deal, but since mem_cgroup_shrink_usage doesn't require a page to
operate upon, page_cache_release the swappage before calling it, so it's
not pinned across the reclaim.
Signed-off-by: Hugh Dickins <hugh@...itas.com>
---
Should follow mmotm's memcg-helper-function-for-relcaim-from-shmem.patch
mm/shmem.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- mmotm/mm/shmem.c 2008-06-27 13:39:20.000000000 +0100
+++ linux/mm/shmem.c 2008-06-27 17:25:41.000000000 +0100
@@ -1315,16 +1315,14 @@ repeat:
shmem_swp_unmap(entry);
spin_unlock(&info->lock);
unlock_page(swappage);
+ page_cache_release(swappage);
if (error == -ENOMEM) {
/* allow reclaim from this memory cgroup */
error = mem_cgroup_shrink_usage(current->mm,
- gfp & ~__GFP_HIGHMEM);
- if (error) {
- page_cache_release(swappage);
+ gfp);
+ if (error)
goto failed;
- }
}
- page_cache_release(swappage);
goto repeat;
}
} else if (sgp == SGP_READ && !filepage) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists