Commit df64f81bb1e01cbef967a96642dacf208acb7e72

Authored by David Rientjes
Committed by Linus Torvalds
1 parent dc10e281f5

memcg: make oom killer a no-op when no killable task can be found

It's pointless to try to kill current if select_bad_process() did not find
an eligible task to kill in mem_cgroup_out_of_memory() since it's
guaranteed that current is a member of the memcg that is oom and it is, by
definition, unkillable.

Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 4 deletions Side-by-side Diff

... ... @@ -479,11 +479,8 @@
479 479 read_lock(&tasklist_lock);
480 480 retry:
481 481 p = select_bad_process(&points, mem);
482   - if (PTR_ERR(p) == -1UL)
  482 + if (!p || PTR_ERR(p) == -1UL)
483 483 goto out;
484   -
485   - if (!p)
486   - p = current;
487 484  
488 485 if (oom_kill_process(p, gfp_mask, 0, points, mem,
489 486 "Memory cgroup out of memory"))