summaryrefslogtreecommitdiff
path: root/drivers/staging/android/lowmemorykiller.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/android/lowmemorykiller.c')
-rw-r--r--drivers/staging/android/lowmemorykiller.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index efc7dc1f483..95ff01b4bc1 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -34,7 +34,6 @@
#include <linux/mm.h>
#include <linux/oom.h>
#include <linux/sched.h>
-#include <linux/profile.h>
#include <linux/notifier.h>
static uint32_t lowmem_debug_level = 2;
@@ -73,10 +72,10 @@ static int
task_notify_func(struct notifier_block *self, unsigned long val, void *data)
{
struct task_struct *task = data;
- if (task == lowmem_deathpending) {
+
+ if (task == lowmem_deathpending)
lowmem_deathpending = NULL;
- task_handoff_unregister(&task_nb);
- }
+
return NOTIFY_OK;
}
@@ -101,8 +100,6 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
* that we have nothing further to offer on
* this pass.
*
- * Note: Currently you need CONFIG_PROFILING
- * for this to work correctly.
*/
if (lowmem_deathpending &&
time_before_eq(jiffies, lowmem_deathpending_timeout))
@@ -173,16 +170,8 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
selected->pid, selected->comm,
selected_oom_adj, selected_tasksize);
- /*
- * If CONFIG_PROFILING is off, then task_handoff_register()
- * is a nop. In that case we don't want to stall the killer
- * by setting lowmem_deathpending.
- */
-#ifdef CONFIG_PROFILING
lowmem_deathpending = selected;
lowmem_deathpending_timeout = jiffies + HZ;
- task_handoff_register(&task_nb);
-#endif
force_sig(SIGKILL, selected);
rem -= selected_tasksize;
}
@@ -199,6 +188,7 @@ static struct shrinker lowmem_shrinker = {
static int __init lowmem_init(void)
{
+ task_free_register(&task_nb);
register_shrinker(&lowmem_shrinker);
return 0;
}
@@ -206,6 +196,7 @@ static int __init lowmem_init(void)
static void __exit lowmem_exit(void)
{
unregister_shrinker(&lowmem_shrinker);
+ task_free_unregister(&task_nb);
}
module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);