All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
@ 2010-11-19  0:39 ` David Sterba
  0 siblings, 0 replies; 8+ messages in thread
From: David Sterba @ 2010-11-19  0:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, David Sterba, Naoya Horiguchi, Andi Kleen,
	Andy Whitcroft, David Rientjes, Hugh Dickins, Lee Schermerhorn,
	Matt Mackall, Mel Gorman, Wu Fengguang

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.

Signed-off-by: David Sterba <dsterba@suse.cz>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Wu Fengguang <fengguang.wu@intel.com>
---
 mm/pagewalk.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index 8b1a2ce..38cc58b 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -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;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
@ 2010-11-19  0:39 ` David Sterba
  0 siblings, 0 replies; 8+ messages in thread
From: David Sterba @ 2010-11-19  0:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, David Sterba, Naoya Horiguchi, Andi Kleen,
	Andy Whitcroft, David Rientjes, Hugh Dickins, Lee Schermerhorn,
	Matt Mackall, Mel Gorman, Wu Fengguang

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.

Signed-off-by: David Sterba <dsterba@suse.cz>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Wu Fengguang <fengguang.wu@intel.com>
---
 mm/pagewalk.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index 8b1a2ce..38cc58b 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -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;
-- 
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  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:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
  2010-11-19  0:39 ` David Sterba
@ 2010-11-19  8:15   ` Naoya Horiguchi
  -1 siblings, 0 replies; 8+ messages in thread
From: Naoya Horiguchi @ 2010-11-19  8:15 UTC (permalink / raw)
  To: David Sterba
  Cc: linux-kernel, linux-mm, Andi Kleen, Andy Whitcroft,
	David Rientjes, Hugh Dickins, Lee Schermerhorn, Matt Mackall,
	Mel Gorman, Wu Fengguang

On Fri, Nov 19, 2010 at 01:39:57AM +0100, David Sterba wrote:
> 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.
> 
> Signed-off-by: David Sterba <dsterba@suse.cz>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Andy Whitcroft <apw@canonical.com>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> ---
>  mm/pagewalk.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/pagewalk.c b/mm/pagewalk.c
> index 8b1a2ce..38cc58b 100644
> --- a/mm/pagewalk.c
> +++ b/mm/pagewalk.c
> @@ -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;

Looks good to me.

Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

Thanks,
Naoya Horiguchi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
@ 2010-11-19  8:15   ` Naoya Horiguchi
  0 siblings, 0 replies; 8+ messages in thread
From: Naoya Horiguchi @ 2010-11-19  8:15 UTC (permalink / raw)
  To: David Sterba
  Cc: linux-kernel, linux-mm, Andi Kleen, Andy Whitcroft,
	David Rientjes, Hugh Dickins, Lee Schermerhorn, Matt Mackall,
	Mel Gorman, Wu Fengguang

On Fri, Nov 19, 2010 at 01:39:57AM +0100, David Sterba wrote:
> 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.
> 
> Signed-off-by: David Sterba <dsterba@suse.cz>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Andy Whitcroft <apw@canonical.com>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> ---
>  mm/pagewalk.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/pagewalk.c b/mm/pagewalk.c
> index 8b1a2ce..38cc58b 100644
> --- a/mm/pagewalk.c
> +++ b/mm/pagewalk.c
> @@ -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;

Looks good to me.

Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

Thanks,
Naoya Horiguchi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  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:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
  2010-11-19  0:39 ` David Sterba
@ 2010-11-19 11:35   ` Mel Gorman
  -1 siblings, 0 replies; 8+ messages in thread
From: Mel Gorman @ 2010-11-19 11:35 UTC (permalink / raw)
  To: David Sterba
  Cc: linux-kernel, linux-mm, Naoya Horiguchi, Andi Kleen,
	Andy Whitcroft, David Rientjes, Hugh Dickins, Lee Schermerhorn,
	Matt Mackall, Wu Fengguang

On Fri, Nov 19, 2010 at 01:39:57AM +0100, David Sterba wrote:
> 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.
> 
> Signed-off-by: David Sterba <dsterba@suse.cz>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Andy Whitcroft <apw@canonical.com>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Wu Fengguang <fengguang.wu@intel.com>

Well spotted.

Acked-by: Mel Gorman <mel@csn.ul.ie>

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
@ 2010-11-19 11:35   ` Mel Gorman
  0 siblings, 0 replies; 8+ messages in thread
From: Mel Gorman @ 2010-11-19 11:35 UTC (permalink / raw)
  To: David Sterba
  Cc: linux-kernel, linux-mm, Naoya Horiguchi, Andi Kleen,
	Andy Whitcroft, David Rientjes, Hugh Dickins, Lee Schermerhorn,
	Matt Mackall, Wu Fengguang

On Fri, Nov 19, 2010 at 01:39:57AM +0100, David Sterba wrote:
> 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.
> 
> Signed-off-by: David Sterba <dsterba@suse.cz>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: Andy Whitcroft <apw@canonical.com>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Wu Fengguang <fengguang.wu@intel.com>

Well spotted.

Acked-by: Mel Gorman <mel@csn.ul.ie>

-- 
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 majordomo@kvack.org.  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:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
  2010-11-19  0:39 ` David Sterba
@ 2010-11-19 20:09   ` Matt Mackall
  -1 siblings, 0 replies; 8+ messages in thread
From: Matt Mackall @ 2010-11-19 20:09 UTC (permalink / raw)
  To: David Sterba
  Cc: linux-kernel, linux-mm, Naoya Horiguchi, Andi Kleen,
	Andy Whitcroft, David Rientjes, Hugh Dickins, Lee Schermerhorn,
	Mel Gorman, Wu Fengguang

On Fri, 2010-11-19 at 01:39 +0100, David Sterba wrote:
> 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.

Looks good to me.

Acked-by: Matt Mackall <mpm@selenic.com>

-- 
Mathematics is the supreme nostalgia of our time.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs
@ 2010-11-19 20:09   ` Matt Mackall
  0 siblings, 0 replies; 8+ messages in thread
From: Matt Mackall @ 2010-11-19 20:09 UTC (permalink / raw)
  To: David Sterba
  Cc: linux-kernel, linux-mm, Naoya Horiguchi, Andi Kleen,
	Andy Whitcroft, David Rientjes, Hugh Dickins, Lee Schermerhorn,
	Mel Gorman, Wu Fengguang

On Fri, 2010-11-19 at 01:39 +0100, David Sterba wrote:
> 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.

Looks good to me.

Acked-by: Matt Mackall <mpm@selenic.com>

-- 
Mathematics is the supreme nostalgia of our time.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  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:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-11-19 22:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-19  0:39 [PATCH] mm: remove call to find_vma in pagewalk for non-hugetlbfs David Sterba
2010-11-19  0:39 ` David Sterba
2010-11-19  8:15 ` Naoya Horiguchi
2010-11-19  8:15   ` Naoya Horiguchi
2010-11-19 11:35 ` Mel Gorman
2010-11-19 11:35   ` Mel Gorman
2010-11-19 20:09 ` Matt Mackall
2010-11-19 20:09   ` Matt Mackall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.