diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2009-04-02 19:57:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 22:04:55 -0400 |
commit | e222432bfa7dcf6ec008622a978c9f284ed5e3a9 (patch) | |
tree | b006f569cb66523a5644ad0ef1669b051ccda907 /include | |
parent | 0b7f569e45bb6be142d87017030669a6a7d327a1 (diff) |
memcg: show memcg information during OOM
Add RSS and swap to OOM output from memcg
Display memcg values like failcnt, usage and limit when an OOM occurs due
to memcg.
Thanks to Johannes Weiner, Li Zefan, David Rientjes, Kamezawa Hiroyuki,
Daisuke Nishimura and KOSAKI Motohiro for review.
Sample output
-------------
Task in /a/x killed as a result of limit of /a
memory: usage 1048576kB, limit 1048576kB, failcnt 4183
memory+swap: usage 1400964kB, limit 9007199254740991kB, failcnt 0
[akpm@linux-foundation.org: compilation fix]
[akpm@linux-foundation.org: fix kerneldoc and whitespace]
[akpm@linux-foundation.org: add printk facility level]
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/memcontrol.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 326f45c86530..7aba9f264622 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -104,6 +104,8 @@ struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, | |||
104 | struct zone *zone); | 104 | struct zone *zone); |
105 | struct zone_reclaim_stat* | 105 | struct zone_reclaim_stat* |
106 | mem_cgroup_get_reclaim_stat_from_page(struct page *page); | 106 | mem_cgroup_get_reclaim_stat_from_page(struct page *page); |
107 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, | ||
108 | struct task_struct *p); | ||
107 | 109 | ||
108 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 110 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
109 | extern int do_swap_account; | 111 | extern int do_swap_account; |
@@ -270,6 +272,11 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page) | |||
270 | return NULL; | 272 | return NULL; |
271 | } | 273 | } |
272 | 274 | ||
275 | static inline void | ||
276 | mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | ||
277 | { | ||
278 | } | ||
279 | |||
273 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 280 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
274 | 281 | ||
275 | #endif /* _LINUX_MEMCONTROL_H */ | 282 | #endif /* _LINUX_MEMCONTROL_H */ |