aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2012-03-05 17:59:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-05 18:49:43 -0500
commite6ca7b89dc76abf77c80887fed54e0a60c87c0a8 (patch)
treeedfd8cce78c61cbf6cd9e738662ad25baa2b2bc0 /mm
parent1c641e84719429bbfe62a95ed3545ee7fe24408f (diff)
memcg: fix mapcount check in move charge code for anonymous page
Currently the charge on shared anonyous pages is supposed not to moved in task migration. To implement this, we need to check that mapcount > 1, instread of > 2. So this patch fixes it. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Hillf Danton <dhillf@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d0e57a3cda18..5585dc3d3646 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5075,7 +5075,7 @@ static struct page *mc_handle_present_pte(struct vm_area_struct *vma,
5075 return NULL; 5075 return NULL;
5076 if (PageAnon(page)) { 5076 if (PageAnon(page)) {
5077 /* we don't move shared anon */ 5077 /* we don't move shared anon */
5078 if (!move_anon() || page_mapcount(page) > 2) 5078 if (!move_anon() || page_mapcount(page) > 1)
5079 return NULL; 5079 return NULL;
5080 } else if (!move_file()) 5080 } else if (!move_file())
5081 /* we ignore mapcount for file pages */ 5081 /* we ignore mapcount for file pages */