2008-01-17 15:34:13

by Larry Woodman

[permalink] [raw]
Subject: [PATCH] fix hugepages leak due to pagetable page sharing.

--- linux-2.6.23/mm/hugetlb.c.orig 2008-01-16 12:05:41.496448000 -0500
+++ linux-2.6.23/mm/hugetlb.c 2008-01-17 10:27:21.740353000 -0500
@@ -377,6 +377,11 @@ int copy_hugetlb_page_range(struct mm_st
dst_pte = huge_pte_alloc(dst, addr);
if (!dst_pte)
goto nomem;
+
+ /* if the pagetables are shared dont copy or take references */
+ if(dst_pte == src_pte)
+ continue;
+
spin_lock(&dst->page_table_lock);
spin_lock(&src->page_table_lock);
if (!pte_none(*src_pte)) {


Attachments:
linux-shared.patch (487.00 B)