diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2010-08-10 21:03:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-11 11:59:19 -0400 |
commit | 158e0a2d1b3cffed8b46cbc56393a1394672ef79 (patch) | |
tree | a044d53137609fdfc8c1afdde366b3e205c96eda /include/linux/oom.h | |
parent | 73045c47b6facbdf4656e6763c8cb469de4337e2 (diff) |
memcg: use find_lock_task_mm() in memory cgroups oom
When the OOM killer scans task, it check a task is under memcg or
not when it's called via memcg's context.
But, as Oleg pointed out, a thread group leader may have NULL ->mm
and task_in_mem_cgroup() may do wrong decision. We have to use
find_lock_task_mm() in memcg as generic OOM-Killer does.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/oom.h')
-rw-r--r-- | include/linux/oom.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/oom.h b/include/linux/oom.h index f209b683e118..5e3aa8311c5e 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -66,6 +66,8 @@ static inline void oom_killer_enable(void) | |||
66 | extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem, | 66 | extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem, |
67 | const nodemask_t *nodemask, unsigned long uptime); | 67 | const nodemask_t *nodemask, unsigned long uptime); |
68 | 68 | ||
69 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | ||
70 | |||
69 | /* sysctls */ | 71 | /* sysctls */ |
70 | extern int sysctl_oom_dump_tasks; | 72 | extern int sysctl_oom_dump_tasks; |
71 | extern int sysctl_oom_kill_allocating_task; | 73 | extern int sysctl_oom_kill_allocating_task; |