memcg: fix mapcount check in move charge code for anonymous page
authorNaoya Horiguchi <[email protected]>
Mon, 5 Mar 2012 22:59:20 +0000 (14:59 -0800)
committerLinus Torvalds <[email protected]>
Mon, 5 Mar 2012 23:49:43 +0000 (15:49 -0800)
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 <[email protected]>
Reviewed-by: Daisuke Nishimura <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Hillf Danton <[email protected]>
Cc: Johannes Weiner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memcontrol.c

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