Browse Source

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>
Naoya Horiguchi 13 years ago
parent
commit
e6ca7b89dc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      mm/memcontrol.c

+ 1 - 1
mm/memcontrol.c

@@ -5075,7 +5075,7 @@ static struct page *mc_handle_present_pte(struct vm_area_struct *vma,
 		return NULL;
 		return NULL;
 	if (PageAnon(page)) {
 	if (PageAnon(page)) {
 		/* we don't move shared anon */
 		/* we don't move shared anon */
-		if (!move_anon() || page_mapcount(page) > 2)
+		if (!move_anon() || page_mapcount(page) > 1)
 			return NULL;
 			return NULL;
 	} else if (!move_file())
 	} else if (!move_file())
 		/* we ignore mapcount for file pages */
 		/* we ignore mapcount for file pages */