Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
oom: oom_kill_process() doesn't select kthread child
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kosaki authored and torvalds committed Aug 10, 2010
1 parent 7c59aec commit 2c5ea53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2c5ea53

Please sign in to comment.