[RFC][PATCH 3/3] use pte pages in OOM score

From: Dave Hansen
Date: Fri Apr 15 2011 - 13:38:39 EST



PTE pages eat up memory just like anything else, but we do
not account for them in any way in the OOM scores. They
are also _guaranteed_ to get freed up when a process is OOM
killed, while RSS is not.

Signed-off-by: Dave Hansen <dave@xxxxxxxxxxxxxxxxxx>
---

linux-2.6.git-dave/mm/oom_kill.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff -puN mm/oom_kill.c~use-pte-pages-in-oom-scire mm/oom_kill.c
--- linux-2.6.git/mm/oom_kill.c~use-pte-pages-in-oom-scire 2011-04-15 10:37:13.184831585 -0700
+++ linux-2.6.git-dave/mm/oom_kill.c 2011-04-15 10:37:13.192831581 -0700
@@ -192,8 +192,10 @@ unsigned int oom_badness(struct task_str
* The baseline for the badness score is the proportion of RAM that each
* task's rss 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) +
+ get_mm_counter(p->mm, MM_SWAPENTS) +
+ get_mm_counter(p->mm, MM_PTEPAGES))
+ * 1000 / totalpages;
task_unlock(p);

/*
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/