diff options
author | 2012-02-10 10:58:25 -0800 | |
---|---|---|
committer | 2012-02-10 10:58:25 -0800 | |
commit | b91867f2ee5c84b550f95ce54c91b180f70f48cb (patch) | |
tree | bd7a5be4484d539af13e6b345320455e989612cf /drivers/staging/android/lowmemorykiller.c | |
parent | Merge tag 'staging-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging (diff) | |
parent | staging: sep: reworked crypto layer (diff) | |
download | linux-dev-b91867f2ee5c84b550f95ce54c91b180f70f48cb.tar.xz linux-dev-b91867f2ee5c84b550f95ce54c91b180f70f48cb.zip |
Merge tag 'staging-3.3-rc3' into staging-next
This was done to resolve some merge issues with the following files that
had changed in both branches:
drivers/staging/rtl8712/rtl871x_sta_mgt.c
drivers/staging/tidspbridge/rmgr/drv_interface.c
drivers/staging/zcache/zcache-main.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/lowmemorykiller.c')
-rw-r--r-- | drivers/staging/android/lowmemorykiller.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index efc7dc1f4831..8b8a537ed063 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -34,6 +34,7 @@ #include <linux/mm.h> #include <linux/oom.h> #include <linux/sched.h> +#include <linux/rcupdate.h> #include <linux/profile.h> #include <linux/notifier.h> @@ -82,7 +83,7 @@ task_notify_func(struct notifier_block *self, unsigned long val, void *data) static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) { - struct task_struct *p; + struct task_struct *tsk; struct task_struct *selected = NULL; int rem = 0; int tasksize; @@ -134,25 +135,24 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) } selected_oom_adj = min_adj; - read_lock(&tasklist_lock); - for_each_process(p) { - struct mm_struct *mm; - struct signal_struct *sig; + rcu_read_lock(); + for_each_process(tsk) { + struct task_struct *p; int oom_adj; - task_lock(p); - mm = p->mm; - sig = p->signal; - if (!mm || !sig) { - task_unlock(p); + if (tsk->flags & PF_KTHREAD) continue; - } - oom_adj = sig->oom_adj; + + p = find_lock_task_mm(tsk); + if (!p) + continue; + + oom_adj = p->signal->oom_adj; if (oom_adj < min_adj) { task_unlock(p); continue; } - tasksize = get_mm_rss(mm); + tasksize = get_mm_rss(p->mm); task_unlock(p); if (tasksize <= 0) continue; @@ -183,12 +183,12 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) lowmem_deathpending_timeout = jiffies + HZ; task_handoff_register(&task_nb); #endif - force_sig(SIGKILL, selected); + send_sig(SIGKILL, selected, 0); rem -= selected_tasksize; } lowmem_print(4, "lowmem_shrink %lu, %x, return %d\n", sc->nr_to_scan, sc->gfp_mask, rem); - read_unlock(&tasklist_lock); + rcu_read_unlock(); return rem; } |