aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2009-01-07 21:08:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:06 -0500
commita636b327f731143ccc544b966cfd8de6cb6d72c6 (patch)
treee53b03b64e8ebca20649c2d877bc4c3ef54ec34c /include/linux/memcontrol.h
parent2e4d40915fb85207fe48cfc31201824ec6d7426e (diff)
memcg: avoid unnecessary system-wide-oom-killer
Current mmtom has new oom function as pagefault_out_of_memory(). It's added for select bad process rathar than killing current. When memcg hit limit and calls OOM at page_fault, this handler called and system-wide-oom handling happens. (means kernel panics if panic_on_oom is true....) To avoid overkill, check memcg's recent behavior before starting system-wide-oom. And this patch also fixes to guarantee "don't accnout against process with TIF_MEMDIE". This is necessary for smooth OOM. [akpm@linux-foundation.org: build fix] Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Badari Pulavarty <pbadari@us.ibm.com> Cc: Jan Blunck <jblunck@suse.de> Cc: Hirokazu Takahashi <taka@valinux.co.jp> Cc: Nick Piggin <nickpiggin@yahoo.com.au> 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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 2de6504e01f..2fdd1380bf0 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -102,6 +102,8 @@ static inline bool mem_cgroup_disabled(void)
102 return false; 102 return false;
103} 103}
104 104
105extern bool mem_cgroup_oom_called(struct task_struct *task);
106
105#else /* CONFIG_CGROUP_MEM_RES_CTLR */ 107#else /* CONFIG_CGROUP_MEM_RES_CTLR */
106struct mem_cgroup; 108struct mem_cgroup;
107 109
@@ -234,6 +236,11 @@ static inline bool mem_cgroup_disabled(void)
234{ 236{
235 return true; 237 return true;
236} 238}
239
240static inline bool mem_cgroup_oom_called(struct task_struct *task)
241{
242 return false;
243}
237#endif /* CONFIG_CGROUP_MEM_CONT */ 244#endif /* CONFIG_CGROUP_MEM_CONT */
238 245
239#endif /* _LINUX_MEMCONTROL_H */ 246#endif /* _LINUX_MEMCONTROL_H */