aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2011-10-31 17:07:15 -0700
committerZiyan <jaraidaniel@gmail.com>2016-03-11 15:56:35 +0100
commit8059a9bce99807af27d23b4a071b243f7b4c87ee (patch)
tree026e3b9525fe38963ac76104beadb00a325907b7 /fs/exec.c
parentc53fc67de39e70735188ec382d3ecebac5b9cdf3 (diff)
downloadkernel_samsung_espresso10-8059a9bce99807af27d23b4a071b243f7b4c87ee.zip
kernel_samsung_espresso10-8059a9bce99807af27d23b4a071b243f7b4c87ee.tar.gz
kernel_samsung_espresso10-8059a9bce99807af27d23b4a071b243f7b4c87ee.tar.bz2
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 9ab31ca..5420cae 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -848,10 +848,6 @@ static int exec_mmap(struct mm_struct *mm)
tsk->mm = mm;
tsk->active_mm = mm;
activate_mm(active_mm, mm);
- if (old_mm && tsk->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) {
- atomic_dec(&old_mm->oom_disable_count);
- atomic_inc(&tsk->mm->oom_disable_count);
- }
task_unlock(tsk);
arch_pick_mmap_layout(mm);
if (old_mm) {