|
@@ -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);
|