]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/oom_kill.c
oom: always return a badness score of non-zero for eligible tasks
[mirror_ubuntu-artful-kernel.git] / mm / oom_kill.c
index fc81cb22869ef54e6871daf39f51b32e3377aa98..859250c7dc06e50568234bdaa24d40b76b7ab910 100644 (file)
@@ -208,8 +208,13 @@ unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
         */
        points += p->signal->oom_score_adj;
 
-       if (points < 0)
-               return 0;
+       /*
+        * Never return 0 for an eligible task that may be killed since it's
+        * possible that no single user task uses more than 0.1% of memory and
+        * no single admin tasks uses more than 3.0%.
+        */
+       if (points <= 0)
+               return 1;
        return (points < 1000) ? points : 1000;
 }