From e5d7965f88a3755b2d0c54768a17032ab3a72819 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= Date: Fri, 13 Jan 2012 22:21:25 +0400 Subject: [PATCH] staging: android: lowmemorykiller: Don't wait more than one second for a process to die MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Arve Hjønnevåg Signed-off-by: Anton Vorontsov Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/lowmemorykiller.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 2d8d2b796101..efc7dc1f4831 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -54,6 +54,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 { \ @@ -103,7 +104,8 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) * Note: Currently you need CONFIG_PROFILING * for this to work correctly. */ - if (lowmem_deathpending) + if (lowmem_deathpending && + time_before_eq(jiffies, lowmem_deathpending_timeout)) return 0; if (lowmem_adj_size < array_size) @@ -178,6 +180,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) */ #ifdef CONFIG_PROFILING lowmem_deathpending = selected; + lowmem_deathpending_timeout = jiffies + HZ; task_handoff_register(&task_nb); #endif force_sig(SIGKILL, selected); -- 2.30.2