Commit c980e66a authored by Jianguo Wu's avatar Jianguo Wu Committed by Linus Torvalds

mm: do_mincore() cleanup

Two cleanups:
1. remove redundant codes for hugetlb pages.
2. end = pmd_addr_end(addr, end) restricts [addr, end) within PMD_SIZE,
   this may increase do_mincore() calls, remove it.
Signed-off-by: default avatarJianguo Wu <>
Acked-by: default avatarJohannes Weiner <>
Cc: Minchan Kim <>
Cc: qiuxishi <>
Reviewed-by: default avatarNaoya Horiguchi <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent b30afea0
......@@ -225,13 +225,6 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
end = min(vma->vm_end, addr + (pages << PAGE_SHIFT));
if (is_vm_hugetlb_page(vma)) {
mincore_hugetlb_page_range(vma, addr, end, vec);
return (end - addr) >> PAGE_SHIFT;
end = pmd_addr_end(addr, end);
if (is_vm_hugetlb_page(vma))
mincore_hugetlb_page_range(vma, addr, end, vec);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment