]> git.baikalelectronics.ru Git - kernel.git/commit
oom: PF_EXITING check should take mm into account
authorOleg Nesterov <oleg@redhat.com>
Tue, 10 Aug 2010 00:18:44 +0000 (17:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Aug 2010 03:44:55 +0000 (20:44 -0700)
commitc250d178ee52c4fc50656407a5f62a53a83a53b4
tree5f44a8af51ccc30847b1d969e0bd36205902d3fb
parentdb8733b9177eea12614b146f1ed9377e456f4d5c
oom: PF_EXITING check should take mm into account

select_bad_process() checks PF_EXITING to detect the task which is going
to release its memory, but the logic is very wrong.

- a single process P with the dead group leader disables
  select_bad_process() completely, it will always return
  ERR_PTR() while P can live forever

- if the PF_EXITING task has already released its ->mm
  it doesn't make sense to expect it is goiing to free
  more memory (except task_struct/etc)

Change the code to ignore the PF_EXITING tasks without ->mm.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/oom_kill.c