rk: revert 20f3d0b+v3.0.66 to v3.0
[firefly-linux-kernel-4.4.55.git] / mm / oom_kill.c
index 7c72487ca459495026387de3c0c0c0302a44dec7..e4b0991ca3516b3fc3590f40da1ede9f8a4ba637 100644 (file)
@@ -162,7 +162,7 @@ static bool oom_unkillable_task(struct task_struct *p,
 unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
                      const nodemask_t *nodemask, unsigned long totalpages)
 {
-       long points;
+       int points;
 
        if (oom_unkillable_task(p, mem, nodemask))
                return 0;
@@ -303,7 +303,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
        do_each_thread(g, p) {
                unsigned int points;
 
-               if (p->exit_state)
+               if (!p->mm)
                        continue;
                if (oom_unkillable_task(p, mem, nodemask))
                        continue;
@@ -319,8 +319,6 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
                 */
                if (test_tsk_thread_flag(p, TIF_MEMDIE))
                        return ERR_PTR(-1UL);
-               if (!p->mm)
-                       continue;
 
                if (p->flags & PF_EXITING) {
                        /*