fix extra page ref count in follow_hugetlb_page
Subsystems (2)
PATCH 1/1 fix extra page ref count in follow_hugetlb_page
"[PATCH] optimize follow_hugetlb_page" breaks mlock on hugepage areas.
I mis-interpret pages argument and made get_page() unconditional. It should only get a ref count when "pages" argument is non-null.
Credit goes to Adam Litke who spotted the bug.
Signed-off-by Ken Chen <[email protected]>
Acked-by Adam Litke <[email protected]>
mm/hugetlb.c renamed from mm/hugetlb.c.orig +3 -2
@@ -555,9 +555,10 @@ int follow_hugetlb_page(struct mm_struct pfn_offset = (vaddr & ~HPAGE_MASK ) >>PAGE_SHIFT ; page =pte_page (*pte); same_page: -get_page (page); -if (pages) +if (pages) { +get_page (page); pages[i] = page + pfn_offset; + }if (vmas) vmas[i] = vma;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>