diff options
author | Greg Thelen <gthelen@google.com> | 2011-01-13 18:47:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:50 -0500 |
commit | 2a7106f2cb0768d00fe8c1eb42a754a7d8518f08 (patch) | |
tree | 730bef06e752c1edcb2d475fd193f94bea00bf6a /mm/rmap.c | |
parent | ece72400c2a27a3d726cb0854449f991d9fcd2da (diff) |
memcg: create extensible page stat update routines
Replace usage of the mem_cgroup_update_file_mapped() memcg
statistic update routine with two new routines:
* mem_cgroup_inc_page_stat()
* mem_cgroup_dec_page_stat()
As before, only the file_mapped statistic is managed. However, these more
general interfaces allow for new statistics to be more easily added. New
statistics are added with memcg dirty page accounting.
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Andrea Righi <arighi@develer.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -937,7 +937,7 @@ void page_add_file_rmap(struct page *page) | |||
937 | { | 937 | { |
938 | if (atomic_inc_and_test(&page->_mapcount)) { | 938 | if (atomic_inc_and_test(&page->_mapcount)) { |
939 | __inc_zone_page_state(page, NR_FILE_MAPPED); | 939 | __inc_zone_page_state(page, NR_FILE_MAPPED); |
940 | mem_cgroup_update_file_mapped(page, 1); | 940 | mem_cgroup_inc_page_stat(page, MEMCG_NR_FILE_MAPPED); |
941 | } | 941 | } |
942 | } | 942 | } |
943 | 943 | ||
@@ -979,7 +979,7 @@ void page_remove_rmap(struct page *page) | |||
979 | NR_ANON_TRANSPARENT_HUGEPAGES); | 979 | NR_ANON_TRANSPARENT_HUGEPAGES); |
980 | } else { | 980 | } else { |
981 | __dec_zone_page_state(page, NR_FILE_MAPPED); | 981 | __dec_zone_page_state(page, NR_FILE_MAPPED); |
982 | mem_cgroup_update_file_mapped(page, -1); | 982 | mem_cgroup_dec_page_stat(page, MEMCG_NR_FILE_MAPPED); |
983 | } | 983 | } |
984 | /* | 984 | /* |
985 | * It would be tidy to reset the PageAnon mapping here, | 985 | * It would be tidy to reset the PageAnon mapping here, |