staging: android/lowmemorykiller: Do not kill kernel threads
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Mon, 6 Feb 2012 16:30:01 +0000 (20:30 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2012 00:55:46 +0000 (16:55 -0800)
LMK should not try killing kernel threads.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/lowmemorykiller.c

index 6e800d35ebdaf7032233bb8bcb839700d66985d0..ae38c39a152500eee8f3729cdfe03ed7dfeeb57d 100644 (file)
@@ -138,6 +138,9 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
                struct task_struct *p;
                int oom_adj;
 
+               if (tsk->flags & PF_KTHREAD)
+                       continue;
+
                p = find_lock_task_mm(tsk);
                if (!p)
                        continue;