]> git.karo-electronics.de Git - karo-tx-linux.git/commit
oom: remove oom_disable_count
authorDavid Rientjes <rientjes@google.com>
Mon, 24 Oct 2011 14:54:02 +0000 (01:54 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 1 Nov 2011 08:40:56 +0000 (19:40 +1100)
commit0292bc14dfa9b84aa7fe86b825971663a1d7981e
treed8cddaf5005bc7dfa46257d2e22c9be4986af88a
parentd57e7e33da32cfd5762ff3865cb85ddef15f021c
oom: remove oom_disable_count

This removes mm->oom_disable_count entirely since it's unnecessary and
currently buggy.  The counter was intended to be per-process but it's
currently decremented in the exit path for each thread that exits, causing
it to underflow.

The count was originally intended to prevent oom killing threads that
share memory with threads that cannot be killed since it doesn't lead to
future memory freeing.  The counter could be fixed to represent all
threads sharing the same mm, but it's better to remove the count since:

 - it is possible that the OOM_DISABLE thread sharing memory with the
   victim is waiting on that thread to exit and will actually cause
   future memory freeing, and

 - there is no guarantee that a thread is disabled from oom killing just
   because another thread sharing its mm is oom disabled.

Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Ying Han <yinghan@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/exec.c
fs/proc/base.c
include/linux/mm_types.h
kernel/exit.c
kernel/fork.c
mm/oom_kill.c