summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorLiam Mark <lmark@codeaurora.org>2013-02-07 14:31:36 -0800
committerJeevan Shriram <jshriram@codeaurora.org>2016-04-13 11:09:29 -0700
commit21f86651a66abefcfce33f4611c2de7863a8642b (patch)
treeb79f37d019d368bdbd61922de7d00add87cfbaad /kernel/fork.c
parentd40b7c124fec2b1c0163a531e778b9974346e37b (diff)
android/lowmemorykiller: Ignore tasks with freed mm
A killed task can stay in the task list long after its memory has been returned to the system, therefore ignore any tasks whose mm struct has been freed. Change-Id: I76394b203b4ab2312437c839976f0ecb7b6dde4e CRs-fixed: 450383 Signed-off-by: Liam Mark <lmark@codeaurora.org>
Diffstat (limited to '')
-rw-r--r--kernel/fork.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 859b949d106f..c9eb86b646ab 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -694,8 +694,9 @@ EXPORT_SYMBOL_GPL(__mmdrop);
/*
* Decrement the use count and release all resources for an mm.
*/
-void mmput(struct mm_struct *mm)
+int mmput(struct mm_struct *mm)
{
+ int mm_freed = 0;
might_sleep();
if (atomic_dec_and_test(&mm->mm_users)) {
@@ -713,7 +714,9 @@ void mmput(struct mm_struct *mm)
if (mm->binfmt)
module_put(mm->binfmt->module);
mmdrop(mm);
+ mm_freed = 1;
}
+ return mm_freed;
}
EXPORT_SYMBOL_GPL(mmput);