mm: remove call to find_vma in pagewalk for non-hugetlbfs
Subsystems (2)
PATCH 1/1 mm: remove call to find_vma in pagewalk for non-hugetlbfs
Commit d33b9f45 introduces a check if a vma is a hugetlbfs one and later in 5dc37642 is moved under #ifdef CONFIG_HUGETLB_PAGE but a needless find_vma call is left behind and it's result not used anywhere else in the function.
The sideefect of caching vma for @addr inside walk->mm is neither utilized in walk_page_range() nor in called functions.
--- mm/pagewalk.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
mm/pagewalk.c +3 -2
@@ -139,7 +139,6 @@ int walk_page_range(unsigned long addr, unsigned long end,pgd_t *pgd;unsigned long next;int err =0 ; -struct vm_area_struct *vma;if (addr >= end)return err;
@@ -149,15 +148,17 @@ int walk_page_range(unsigned long addr, unsigned long end, pgd =pgd_offset (walk->mm, addr); do { + struct vm_area_struct *uninitialized_var(vma); + next = pgd_addr_end(addr, end); +#ifdef CONFIG_HUGETLB_PAGE /* * handle hugetlb vma individually because pagetable walk for * the hugetlb page is dependent on the architecture and * we can't handled it in the same manner as non-huge pages. */ vma = find_vma(walk->mm, addr); -#ifdef CONFIG_HUGETLB_PAGE if (vma && is_vm_hugetlb_page(vma)) { if (vma->vm_end < next) next = vma->vm_end;
Signature · 1 line
1.7.1
Quoted 43 lines · David Sterba
Commit
d33b9f45introduces a check if a vma is a hugetlbfs one and later in5dc37642is moved under #ifdefCONFIG_HUGETLB_PAGEbut a needlessfind_vmacall is left behind and it's result not used anywhere else in the function.The sideefect of caching vma for @addr inside
walk->mmis neither utilized inwalk_page_range()nor in called functions.Signed-off-by David Sterba <[email protected]>Cc Naoya Horiguchi <[email protected]>Cc Andi Kleen <[email protected]>Cc Andy Whitcroft <[email protected]>Cc David Rientjes <[email protected]>Cc Hugh Dickins <[email protected]>Cc Lee Schermerhorn <[email protected]>Cc Matt Mackall <[email protected]>Cc Mel Gorman <[email protected]>Cc Wu Fengguang <[email protected]>--- mm/pagewalk.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)mm/pagewalk.c +3
-1@@ -139,7 +139,6 @@ int walk_page_range(unsigned long addr, unsigned long end,pgd_t *pgd;unsigned long next;int err =0 ; -struct vm_area_struct *vma;if (addr >= end)return err;@@ -149,15 +148,17 @@ int walk_page_range(unsigned long addr, unsigned long end, pgd =pgd_offset (walk->mm, addr); do { + struct vm_area_struct *uninitialized_var(vma); + next = pgd_addr_end(addr, end); +#ifdef CONFIG_HUGETLB_PAGE
mm/pagewalk.c int walk_page_range(unsigned long addr, unsigned long end, · line 164
Quoted 10 lines
mm/pagewalk.c +0
-1/* * handle hugetlb vma individually because pagetable walk for * the hugetlb page is dependent on the architecture and * we can't handled it in the same manner as non-huge pages. */ vma =find_vma (walk->mm, addr); -#ifdef CONFIG_HUGETLB_PAGE if (vma &&is_vm_hugetlb_page (vma)) {if (vma->vm_end < next) next = vma->vm_end;
Looks good to me.
Thanks,
Naoya Horiguchi
--
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/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 8 lines · David Sterba
Commit
d33b9f45introduces a check if a vma is a hugetlbfs one and later in5dc37642is moved under #ifdefCONFIG_HUGETLB_PAGEbut a needlessfind_vmacall is left behind and it's result not used anywhere else in the function.The sideefect of caching vma for @addr inside
walk->mmis neither utilized inwalk_page_range()nor in called functions.
Quoted 10 lines
Signed-off-by David Sterba <[email protected]>Cc Naoya Horiguchi <[email protected]>Cc Andi Kleen <[email protected]>Cc Andy Whitcroft <[email protected]>Cc David Rientjes <[email protected]>Cc Hugh Dickins <[email protected]>Cc Lee Schermerhorn <[email protected]>Cc Matt Mackall <[email protected]>Cc Mel Gorman <[email protected]>Cc Wu Fengguang <[email protected]>
Well spotted.
Signature · 10 lines
Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab -- 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/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · David Sterba
Commit
d33b9f45introduces a check if a vma is a hugetlbfs one and later in5dc37642is moved under #ifdefCONFIG_HUGETLB_PAGEbut a needlessfind_vmacall is left behind and it's result not used anywhere else in the function.The sideefect of caching vma for @addr inside
walk->mmis neither utilized inwalk_page_range()nor in called functions.
Looks good to me.
Signature · 9 lines
Mathematics is the supreme nostalgia of our time. -- 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/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>