|
@@ -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
|
|
* 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);
|
|
task_unlock(p);
|
|
|
|
|
|
/*
|
|
/*
|