summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2010-11-23 18:20:28 -0800
committerNiket Sirsi <nsirsi@nvidia.com>2011-01-07 10:23:32 -0800
commit8e82ef6e5e908da257d595218d9c273a1eec8eec (patch)
tree20cbb6a77e14aa71c3a392ae603711b06a161bdd
parent8b31719041662bae54d9acbef4e8c907756cdb6c (diff)
staging: android: lowmemorykiller: Don't wait more than one second for a process to dietegra-10.9.9
If a process forked and the child process was killed by the lowmemorykiller, the lowmemory killer would be disabled until the parent process reaped the child or it died itself. Change-Id: I49822d847ee54876b474a837743b4f4821fba57f Signed-off-by: Arve Hjønnevåg <arve@android.com> Reviewed-on: http://git-master/r/15091 Reviewed-by: Ching Kuang (Roger) Hsieh <rhsieh@nvidia.com> Tested-by: Ching Kuang (Roger) Hsieh <rhsieh@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/staging/android/lowmemorykiller.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index 37ed0f8c432c..a0303e3fe136 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -53,6 +53,7 @@ static size_t lowmem_minfree[6] = {
static int lowmem_minfree_size = 4;
static struct task_struct *lowmem_deathpending;
+static unsigned long lowmem_deathpending_timeout;
#define lowmem_print(level, x...) \
do { \
@@ -99,7 +100,8 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
* this pass.
*
*/
- if (lowmem_deathpending)
+ if (lowmem_deathpending &&
+ time_before_eq(jiffies, lowmem_deathpending_timeout))
return 0;
if (lowmem_adj_size < array_size)
@@ -168,6 +170,7 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
selected->pid, selected->comm,
selected_oom_adj, selected_tasksize);
lowmem_deathpending = selected;
+ lowmem_deathpending_timeout = jiffies + HZ;
force_sig(SIGKILL, selected);
rem -= selected_tasksize;
}