Skip to content

Commit f88ccad

Browse files
kosakitorvalds
authored andcommitted
oom: oom_kill_process() needs to check that p is unkillable
When oom_kill_allocating_task is enabled, an argument task of oom_kill_process is not selected by select_bad_process(), It's just out_of_memory() caller task. It mean the task can be unkillable. check it first. 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 ab290ad commit f88ccad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mm/oom_kill.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
687687
check_panic_on_oom(constraint, gfp_mask, order);
688688

689689
read_lock(&tasklist_lock);
690-
if (sysctl_oom_kill_allocating_task) {
690+
if (sysctl_oom_kill_allocating_task &&
691+
!oom_unkillable_task(current, NULL, nodemask)) {
691692
/*
692693
* oom_kill_process() needs tasklist_lock held. If it returns
693694
* non-zero, current could not be killed so we must fallback to

0 commit comments

Comments
 (0)