mm: do_mincore() cleanup
authorJianguo Wu <[email protected]>
Thu, 23 Jan 2014 23:53:19 +0000 (15:53 -0800)
committerLinus Torvalds <[email protected]>
Fri, 24 Jan 2014 00:36:52 +0000 (16:36 -0800)
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: Jianguo Wu <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: qiuxishi <[email protected]>
Reviewed-by: Naoya Horiguchi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mincore.c

index da2be56a7b8fdd3c8391fd79e758f394dd63157a..101623378fbf636cda807db6deb9bc0ebbf8d6d3 100644 (file)
@@ -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);
        else