Protect global init (PID#1) from getting killed
authorŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 6 May 2013 12:03:46 +0000 (14:03 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 6 May 2013 14:09:07 +0000 (16:09 +0200)
OOM killer MUST NOT kill the global init. The same way init is protected
in mm/oom_kill.c.

Change-Id: Ia8d192e26b0fe3262efb18f62ac92fc8ada3f8a3
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
drivers/misc/slp_lowmem_notify.c

index 9a3fb5b..7d00fdc 100644 (file)
@@ -142,7 +142,7 @@ static int memnotify_victim_task(int force_kill, gfp_t gfp_mask)
        for_each_process(p) {
                if (!p->mm)
                        continue;
-               if (OOMADJ_OF(p) == OOM_DISABLE)        /* OOM_DISABLE skip */
+               if (OOMADJ_OF(p) == OOM_DISABLE || is_global_init(p))   /* skip OOM_DISABLE and PID#1 */
                        continue;
                if ((total_selected_tasksize * PAGE_SIZE) >
                    memnotify_leave_thresholds[THRESHOLD_LOW]