On Fri, 17 Feb 2012 13:46:00 -0800 akpm@xxxxxxxxxxxxxxxxxxxx wrote: > > The patch titled > Subject: memcg: remove PCG_FILE_MAPPED > has been added to the -mm tree. Its filename is > memcg-remove-pcg_file_mapped.patch > > Before you just go and hit "reply", please: > a) Consider who else should be cc'ed > b) Prefer to cc a suitable mailing list as well > c) Ideally: find the original patch on the mailing list and do a > reply-to-all to that, adding suitable additional cc's > > *** Remember to use Documentation/SubmitChecklist when testing your code *** > > The -mm tree is included into linux-next and is updated > there every 3-4 working days > > ------------------------------------------------------ > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> > Subject: memcg: remove PCG_FILE_MAPPED > > With the new lock scheme for updating memcg's page stat, we don't need a > flag PCG_FILE_MAPPED which was duplicated information of page_mapped(). > Johannes and Hillf pointed out this is required. Thank you!. == >From eed3550a81bc53a3d084a295e56654a18455103f Mon Sep 17 00:00:00 2001 From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Date: Mon, 20 Feb 2012 09:19:44 +0900 Subject: [PATCH] memcg: fix remove PCG_FILE_MAPPED At move_acount(), accounting information nr_file_mapped per memcg is moved from old cgroup to new one. The patch memcg-remove-pcg_file_mapped.patch chesk the condition by if (page_mapped(page)) But we want to count only FILE_MAPPED. Then, this should be if (!PageAnon(page) && page_mapped(page)) This handles following cases. - anon + mapped => false - anon + unmapped => false (swap cache) - shmem + mapped => true - shmem + unmapped => false (swap cache) - file + mapped => true - file + unmapped => false Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> --- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e19cffb..dc1701c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2555,7 +2555,7 @@ static int mem_cgroup_move_account(struct page *page, move_lock_mem_cgroup(from, &flags); - if (page_mapped(page)) { + if (!PageAnon(page) && page_mapped(page)) { /* Update mapped_file data for mem_cgroup */ preempt_disable(); __this_cpu_dec(from->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]); -- 1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>