Skip to content

Commit 2c5ea53

Browse files
kosakitorvalds
authored andcommitted
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 <[email protected]> Reviewed-by: Minchan Kim <[email protected]> Cc: David Rientjes <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7c59aec commit 2c5ea53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mm/oom_kill.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
467467

468468
if (child->mm == p->mm)
469469
continue;
470+
if (child->flags & PF_KTHREAD)
471+
continue;
470472
if (mem && !task_in_mem_cgroup(child, mem))
471473
continue;
472474
if (!has_intersects_mems_allowed(child, nodemask))

0 commit comments

Comments
 (0)