]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/oom_kill.c
[media] mceusb: Formosa e017 device has no tx
[mirror_ubuntu-zesty-kernel.git] / mm / oom_kill.c
index 83fb72c108b7947a7b18989455607e14ead0084f..f52e85c80e8d554fcae1a7ad40e0617c0bb1318f 100644 (file)
@@ -172,10 +172,13 @@ unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
 
        /*
         * The baseline for the badness score is the proportion of RAM that each
-        * task's rss and swap space use.
+        * task's rss, pagetable and swap space use.
         */
-       points = (get_mm_rss(p->mm) + get_mm_counter(p->mm, MM_SWAPENTS)) * 1000 /
-                       totalpages;
+       points = get_mm_rss(p->mm) + p->mm->nr_ptes;
+       points += get_mm_counter(p->mm, MM_SWAPENTS);
+
+       points *= 1000;
+       points /= totalpages;
        task_unlock(p);
 
        /*