diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2009-06-17 19:26:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 16:03:47 -0400 |
commit | d69b042f3d7406ddba560143b1796020df760800 (patch) | |
tree | 6b704864716240aa1282d06bb79c02ef4b77e16d /include/linux/memcontrol.h | |
parent | cd5008196f7e583f4c558531a2bca59f6c674c5b (diff) |
memcg: add file-based RSS accounting
Add file RSS tracking per memory cgroup
We currently don't track file RSS, the RSS we report is actually anon RSS.
All the file mapped pages, come in through the page cache and get
accounted there. This patch adds support for accounting file RSS pages.
It should
1. Help improve the metrics reported by the memory resource controller
2. Will form the basis for a future shared memory accounting heuristic
that has been proposed by Kamezawa.
Unfortunately, we cannot rename the existing "rss" keyword used in
memory.stat to "anon_rss". We however, add "mapped_file" data and hope to
educate the end user through documentation.
[hugh.dickins@tiscali.co.uk: fix mem_cgroup_update_mapped_file_stat oops]
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.cn>
Cc: Paul Menage <menage@google.com>
Cc: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 45add35dda1b..e46a0734ab6e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -117,7 +117,7 @@ static inline bool mem_cgroup_disabled(void) | |||
117 | } | 117 | } |
118 | 118 | ||
119 | extern bool mem_cgroup_oom_called(struct task_struct *task); | 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); |
120 | 120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); | |
121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
122 | struct mem_cgroup; | 122 | struct mem_cgroup; |
123 | 123 | ||
@@ -271,6 +271,11 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
271 | { | 271 | { |
272 | } | 272 | } |
273 | 273 | ||
274 | static inline void mem_cgroup_update_mapped_file_stat(struct page *page, | ||
275 | int val) | ||
276 | { | ||
277 | } | ||
278 | |||
274 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 279 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
275 | 280 | ||
276 | #endif /* _LINUX_MEMCONTROL_H */ | 281 | #endif /* _LINUX_MEMCONTROL_H */ |