summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2010-11-23 18:20:28 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:38:26 -0800
commit76090dd04ae3f9c22e6afedc49aa8c34a70301f6 (patch)
tree4aff04af03deeeebb674400ab777add7aa513630 /drivers/staging
parent11398784f28a0fc7ff761b7a6982721a5a664dc8 (diff)
staging: android: lowmemorykiller: Don't wait more than one second for a process to die
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: I709b1a4e1b1a1970e51d26a39fcbee57977bbc7f Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'drivers/staging')
-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 efbe556ba862..4c455cf9176d 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(struct shrinker *s, 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(struct shrinker *s, 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;
}