forked from Minki/linux
oom: oom_kill_process() doesn't select kthread child
Presently select_bad_process() has a PF_KTHREAD check, but oom_kill_process doesn't. It mean oom_kill_process() may choose wrong task, especially, when the child are using use_mm(). Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Cc: David Rientjes <rientjes@google.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
7c59aec830
commit
2c5ea53ce4
@ -467,6 +467,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
|
||||
|
||||
if (child->mm == p->mm)
|
||||
continue;
|
||||
if (child->flags & PF_KTHREAD)
|
||||
continue;
|
||||
if (mem && !task_in_mem_cgroup(child, mem))
|
||||
continue;
|
||||
if (!has_intersects_mems_allowed(child, nodemask))
|
||||
|
Loading…
Reference in New Issue
Block a user