The patch titled shared page table for hugetlb page - v2 (comments) has been added to the -mm tree. Its filename is shared-page-table-for-hugetlb-page-v2-comments.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: shared page table for hugetlb page - v2 (comments) From: "Chen, Kenneth W" <kenneth.w.chen@xxxxxxxxx> Signed-off-by: Ken Chen <kenneth.w.chen@xxxxxxxxx> Cc: Dave McCracken <dmccr@xxxxxxxxxx> Cc: Hugh Dickins <hugh@xxxxxxxxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Cc: Adam Litke <agl@xxxxxxxxxx> Cc: David Gibson <david@xxxxxxxxxxxxxxxxxxxxx> Cc: William Lee Irwin III <wli@xxxxxxxxxxxxxx> Cc: Andi Kleen <ak@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/i386/mm/hugetlbpage.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff -puN arch/i386/mm/hugetlbpage.c~shared-page-table-for-hugetlb-page-v2-comments arch/i386/mm/hugetlbpage.c --- a/arch/i386/mm/hugetlbpage.c~shared-page-table-for-hugetlb-page-v2-comments +++ a/arch/i386/mm/hugetlbpage.c @@ -58,6 +58,11 @@ static void pmd_share(struct vm_area_str spin_lock(&svma->vm_mm->page_table_lock); spte = huge_pte_offset(svma->vm_mm, addr); + /* + * if a valid hugetlb pte is found, take a reference count + * on the pte page. We can then safely populate it into + * pud at a later point. + */ if (spte) get_page(virt_to_page(spte)); spin_unlock(&svma->vm_mm->page_table_lock); @@ -77,6 +82,16 @@ static void pmd_share(struct vm_area_str spin_unlock(&vma->vm_mm->page_table_lock); } +/* + * unmap huge page backed by shared pte. + * + * Hugetlb pte page is ref counted at the time of mapping. If pte is shared + * indicated by page_count > 1, unmap is achieved by clearing pud and + * decrementing the ref count. If count == 1, the pte page is not shared. + * + * returns: 1 successfully unmapped a shared pte page + * 0 the underlying pte page is not shared, or it is the last user + */ int huge_pte_put(struct vm_area_struct *vma, unsigned long *addr, pte_t *ptep) { pgd_t *pgd = pgd_offset(vma->vm_mm, *addr); _ Patches currently in -mm which might be from kenneth.w.chen@xxxxxxxxx are shared-page-table-for-hugetlb-page-v2.patch shared-page-table-for-hugetlb-page-v2-tidy.patch shared-page-table-for-hugetlb-page-v2-comments.patch clean-up-unused-kiocb-variables.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html