The patch titled hugetlb: forget rss with pt sharing has been added to the -mm tree. Its filename is htlb-forget-rss-with-pt-sharing.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: hugetlb: forget rss with pt sharing From: "Chen, Kenneth W" <kenneth.w.chen@xxxxxxxxx> Imprecise RSS accounting is an irritating ill effect with pt sharing. After consulted with several VM experts, I have tried various methods to solve that problem: (1) iterate through all mm_structs that share the PT and increment count; (2) keep RSS count in page table structure and then sum them up at reporting time. None of the above methods yield any satisfactory implementation. Since process RSS accounting is pure information only, I propose we don't count them at all for hugetlb page. rlimit has such field, though there is absolutely no enforcement on limiting that resource. One other method is to account all RSS at hugetlb mmap time regardless they are faulted or not. I opt for the simplicity of no accounting at all. Signed-off-by: Ken Chen <kenneth.w.chen@xxxxxxxxx> Cc: Hugh Dickins <hugh@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/hugetlb.c | 8 -------- 1 file changed, 8 deletions(-) diff -puN mm/hugetlb.c~htlb-forget-rss-with-pt-sharing mm/hugetlb.c --- a/mm/hugetlb.c~htlb-forget-rss-with-pt-sharing +++ a/mm/hugetlb.c @@ -344,7 +344,6 @@ int copy_hugetlb_page_range(struct mm_st entry = *src_pte; ptepage = pte_page(entry); get_page(ptepage); - add_mm_counter(dst, file_rss, HPAGE_SIZE / PAGE_SIZE); set_huge_pte_at(dst, addr, dst_pte, entry); } spin_unlock(&src->page_table_lock); @@ -372,10 +371,6 @@ void __unmap_hugepage_range(struct vm_ar BUG_ON(end & ~HPAGE_MASK); spin_lock(&mm->page_table_lock); - - /* Update high watermark before we lower rss */ - update_hiwater_rss(mm); - for (address = start; address < end; address += HPAGE_SIZE) { ptep = huge_pte_offset(mm, address); if (!ptep) @@ -390,9 +385,7 @@ void __unmap_hugepage_range(struct vm_ar page = pte_page(pte); list_add(&page->lru, &page_list); - add_mm_counter(mm, file_rss, (int) -(HPAGE_SIZE / PAGE_SIZE)); } - spin_unlock(&mm->page_table_lock); flush_tlb_range(vma, start, end); list_for_each_entry_safe(page, tmp, &page_list, lru) { @@ -507,7 +500,6 @@ retry: if (!pte_none(*ptep)) goto backout; - add_mm_counter(mm, file_rss, HPAGE_SIZE / PAGE_SIZE); new_pte = make_huge_pte(vma, page, ((vma->vm_flags & VM_WRITE) && (vma->vm_flags & VM_SHARED))); set_huge_pte_at(mm, address, ptep, new_pte); _ Patches currently in -mm which might be from kenneth.w.chen@xxxxxxxxx are shared-page-table-for-hugetlb-page-v4.patch htlb-forget-rss-with-pt-sharing.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