All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jan Beulich <JBeulich@novell.com>
Cc: linux-kernel@vger.kernel.org, tony.luck@intel.com, tj@kernel.org,
	linux-mm@kvack.org, linux-ia64@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] mm/vmalloc: don't use vmalloc_end
Date: Mon, 07 Dec 2009 23:35:52 +0000	[thread overview]
Message-ID: <20091207153552.0fadf335.akpm@linux-foundation.org> (raw)
In-Reply-To: <4B1D3A3302000078000241CD@vpn.id2.novell.com>

(cc linux-ia64)

On Mon, 07 Dec 2009 16:24:03 +0000
"Jan Beulich" <JBeulich@novell.com> wrote:

> At least on ia64 vmalloc_end is a global variable that VMALLOC_END
> expands to. Hence having a local variable named vmalloc_end and
> initialized from VMALLOC_END won't work on such platforms. Rename
> these variables, and for consistency also rename vmalloc_start.
> 

erk.  So does 2.6.32's vmalloc() actually work correctly on ia64?

Perhaps vmalloc_end wasn't a well chosen name for an arch-specific
global variable.

arch/m68k/include/asm/pgtable_mm.h does the same thing.  Did it break too?

> ---
>  mm/vmalloc.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> --- linux-2.6.32/mm/vmalloc.c
> +++ 2.6.32-dont-use-vmalloc_end/mm/vmalloc.c
> @@ -2060,13 +2060,13 @@ static unsigned long pvm_determine_end(s
>  				       struct vmap_area **pprev,
>  				       unsigned long align)
>  {
> -	const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
> +	const unsigned long end = VMALLOC_END & ~(align - 1);
>  	unsigned long addr;
>  
>  	if (*pnext)
> -		addr = min((*pnext)->va_start & ~(align - 1), vmalloc_end);
> +		addr = min((*pnext)->va_start & ~(align - 1), end);
>  	else
> -		addr = vmalloc_end;
> +		addr = end;
>  
>  	while (*pprev && (*pprev)->va_end > addr) {
>  		*pnext = *pprev;
> @@ -2105,8 +2105,8 @@ struct vm_struct **pcpu_get_vm_areas(con
>  				     const size_t *sizes, int nr_vms,
>  				     size_t align, gfp_t gfp_mask)
>  {
> -	const unsigned long vmalloc_start = ALIGN(VMALLOC_START, align);
> -	const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
> +	const unsigned long vstart = ALIGN(VMALLOC_START, align);
> +	const unsigned long vend = VMALLOC_END & ~(align - 1);
>  	struct vmap_area **vas, *prev, *next;
>  	struct vm_struct **vms;
>  	int area, area2, last_area, term_area;
> @@ -2142,7 +2142,7 @@ struct vm_struct **pcpu_get_vm_areas(con
>  	}
>  	last_end = offsets[last_area] + sizes[last_area];
>  
> -	if (vmalloc_end - vmalloc_start < last_end) {
> +	if (vend - vstart < last_end) {
>  		WARN_ON(true);
>  		return NULL;
>  	}
> @@ -2167,7 +2167,7 @@ retry:
>  	end = start + sizes[area];
>  
>  	if (!pvm_find_next_prev(vmap_area_pcpu_hole, &next, &prev)) {
> -		base = vmalloc_end - last_end;
> +		base = vend - last_end;
>  		goto found;
>  	}
>  	base = pvm_determine_end(&next, &prev, align) - end;
> @@ -2180,7 +2180,7 @@ retry:
>  		 * base might have underflowed, add last_end before
>  		 * comparing.
>  		 */
> -		if (base + last_end < vmalloc_start + last_end) {
> +		if (base + last_end < vstart + last_end) {
>  			spin_unlock(&vmap_area_lock);
>  			if (!purged) {
>  				purge_vmap_area_lazy();
> 

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: "Jan Beulich" <JBeulich@novell.com>
Cc: <linux-kernel@vger.kernel.org>, <tony.luck@intel.com>,
	<tj@kernel.org>, <linux-mm@kvack.org>,
	linux-ia64@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] mm/vmalloc: don't use vmalloc_end
Date: Mon, 7 Dec 2009 15:35:52 -0800	[thread overview]
Message-ID: <20091207153552.0fadf335.akpm@linux-foundation.org> (raw)
In-Reply-To: <4B1D3A3302000078000241CD@vpn.id2.novell.com>

(cc linux-ia64)

On Mon, 07 Dec 2009 16:24:03 +0000
"Jan Beulich" <JBeulich@novell.com> wrote:

> At least on ia64 vmalloc_end is a global variable that VMALLOC_END
> expands to. Hence having a local variable named vmalloc_end and
> initialized from VMALLOC_END won't work on such platforms. Rename
> these variables, and for consistency also rename vmalloc_start.
> 

erk.  So does 2.6.32's vmalloc() actually work correctly on ia64?

Perhaps vmalloc_end wasn't a well chosen name for an arch-specific
global variable.

arch/m68k/include/asm/pgtable_mm.h does the same thing.  Did it break too?

> ---
>  mm/vmalloc.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> --- linux-2.6.32/mm/vmalloc.c
> +++ 2.6.32-dont-use-vmalloc_end/mm/vmalloc.c
> @@ -2060,13 +2060,13 @@ static unsigned long pvm_determine_end(s
>  				       struct vmap_area **pprev,
>  				       unsigned long align)
>  {
> -	const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
> +	const unsigned long end = VMALLOC_END & ~(align - 1);
>  	unsigned long addr;
>  
>  	if (*pnext)
> -		addr = min((*pnext)->va_start & ~(align - 1), vmalloc_end);
> +		addr = min((*pnext)->va_start & ~(align - 1), end);
>  	else
> -		addr = vmalloc_end;
> +		addr = end;
>  
>  	while (*pprev && (*pprev)->va_end > addr) {
>  		*pnext = *pprev;
> @@ -2105,8 +2105,8 @@ struct vm_struct **pcpu_get_vm_areas(con
>  				     const size_t *sizes, int nr_vms,
>  				     size_t align, gfp_t gfp_mask)
>  {
> -	const unsigned long vmalloc_start = ALIGN(VMALLOC_START, align);
> -	const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
> +	const unsigned long vstart = ALIGN(VMALLOC_START, align);
> +	const unsigned long vend = VMALLOC_END & ~(align - 1);
>  	struct vmap_area **vas, *prev, *next;
>  	struct vm_struct **vms;
>  	int area, area2, last_area, term_area;
> @@ -2142,7 +2142,7 @@ struct vm_struct **pcpu_get_vm_areas(con
>  	}
>  	last_end = offsets[last_area] + sizes[last_area];
>  
> -	if (vmalloc_end - vmalloc_start < last_end) {
> +	if (vend - vstart < last_end) {
>  		WARN_ON(true);
>  		return NULL;
>  	}
> @@ -2167,7 +2167,7 @@ retry:
>  	end = start + sizes[area];
>  
>  	if (!pvm_find_next_prev(vmap_area_pcpu_hole, &next, &prev)) {
> -		base = vmalloc_end - last_end;
> +		base = vend - last_end;
>  		goto found;
>  	}
>  	base = pvm_determine_end(&next, &prev, align) - end;
> @@ -2180,7 +2180,7 @@ retry:
>  		 * base might have underflowed, add last_end before
>  		 * comparing.
>  		 */
> -		if (base + last_end < vmalloc_start + last_end) {
> +		if (base + last_end < vstart + last_end) {
>  			spin_unlock(&vmap_area_lock);
>  			if (!purged) {
>  				purge_vmap_area_lazy();
> 

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Jan Beulich <JBeulich@novell.com>
Cc: linux-kernel@vger.kernel.org, tony.luck@intel.com, tj@kernel.org,
	linux-mm@kvack.org, linux-ia64@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] mm/vmalloc: don't use vmalloc_end
Date: Mon, 7 Dec 2009 15:35:52 -0800	[thread overview]
Message-ID: <20091207153552.0fadf335.akpm@linux-foundation.org> (raw)
In-Reply-To: <4B1D3A3302000078000241CD@vpn.id2.novell.com>

(cc linux-ia64)

On Mon, 07 Dec 2009 16:24:03 +0000
"Jan Beulich" <JBeulich@novell.com> wrote:

> At least on ia64 vmalloc_end is a global variable that VMALLOC_END
> expands to. Hence having a local variable named vmalloc_end and
> initialized from VMALLOC_END won't work on such platforms. Rename
> these variables, and for consistency also rename vmalloc_start.
> 

erk.  So does 2.6.32's vmalloc() actually work correctly on ia64?

Perhaps vmalloc_end wasn't a well chosen name for an arch-specific
global variable.

arch/m68k/include/asm/pgtable_mm.h does the same thing.  Did it break too?

> ---
>  mm/vmalloc.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> --- linux-2.6.32/mm/vmalloc.c
> +++ 2.6.32-dont-use-vmalloc_end/mm/vmalloc.c
> @@ -2060,13 +2060,13 @@ static unsigned long pvm_determine_end(s
>  				       struct vmap_area **pprev,
>  				       unsigned long align)
>  {
> -	const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
> +	const unsigned long end = VMALLOC_END & ~(align - 1);
>  	unsigned long addr;
>  
>  	if (*pnext)
> -		addr = min((*pnext)->va_start & ~(align - 1), vmalloc_end);
> +		addr = min((*pnext)->va_start & ~(align - 1), end);
>  	else
> -		addr = vmalloc_end;
> +		addr = end;
>  
>  	while (*pprev && (*pprev)->va_end > addr) {
>  		*pnext = *pprev;
> @@ -2105,8 +2105,8 @@ struct vm_struct **pcpu_get_vm_areas(con
>  				     const size_t *sizes, int nr_vms,
>  				     size_t align, gfp_t gfp_mask)
>  {
> -	const unsigned long vmalloc_start = ALIGN(VMALLOC_START, align);
> -	const unsigned long vmalloc_end = VMALLOC_END & ~(align - 1);
> +	const unsigned long vstart = ALIGN(VMALLOC_START, align);
> +	const unsigned long vend = VMALLOC_END & ~(align - 1);
>  	struct vmap_area **vas, *prev, *next;
>  	struct vm_struct **vms;
>  	int area, area2, last_area, term_area;
> @@ -2142,7 +2142,7 @@ struct vm_struct **pcpu_get_vm_areas(con
>  	}
>  	last_end = offsets[last_area] + sizes[last_area];
>  
> -	if (vmalloc_end - vmalloc_start < last_end) {
> +	if (vend - vstart < last_end) {
>  		WARN_ON(true);
>  		return NULL;
>  	}
> @@ -2167,7 +2167,7 @@ retry:
>  	end = start + sizes[area];
>  
>  	if (!pvm_find_next_prev(vmap_area_pcpu_hole, &next, &prev)) {
> -		base = vmalloc_end - last_end;
> +		base = vend - last_end;
>  		goto found;
>  	}
>  	base = pvm_determine_end(&next, &prev, align) - end;
> @@ -2180,7 +2180,7 @@ retry:
>  		 * base might have underflowed, add last_end before
>  		 * comparing.
>  		 */
> -		if (base + last_end < vmalloc_start + last_end) {
> +		if (base + last_end < vstart + last_end) {
>  			spin_unlock(&vmap_area_lock);
>  			if (!purged) {
>  				purge_vmap_area_lazy();
> 

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-12-07 23:35 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 16:24 [PATCH] mm/vmalloc: don't use vmalloc_end Jan Beulich
2009-12-07 16:24 ` Jan Beulich
2009-12-07 23:35 ` Andrew Morton [this message]
2009-12-07 23:35   ` Andrew Morton
2009-12-07 23:35   ` Andrew Morton
2009-12-08  0:33   ` Tejun Heo
2009-12-08  0:33     ` Tejun Heo
2009-12-08  0:33     ` Tejun Heo
2009-12-08  0:40   ` Tejun Heo
2009-12-08  0:40     ` Tejun Heo
2009-12-08  0:40     ` Tejun Heo
2009-12-08  6:57     ` [PATCH] m68k: don't alias VMALLOC_END to vmalloc_end Tejun Heo
2009-12-08  6:57       ` Tejun Heo
2009-12-08  6:57       ` Tejun Heo
2009-12-08  9:08       ` Geert Uytterhoeven
2009-12-08  9:08         ` Geert Uytterhoeven
2009-12-08  9:08         ` Geert Uytterhoeven
2009-12-08  0:50   ` [PATCH] mm/vmalloc: don't use vmalloc_end Matthew Wilcox
2009-12-08  0:50     ` Matthew Wilcox
2009-12-08  0:50     ` Matthew Wilcox
2009-12-08  1:03     ` Andrew Morton
2009-12-08  1:03       ` Andrew Morton
2009-12-08  1:03       ` Andrew Morton
2009-12-08  8:23   ` Jan Beulich
2009-12-08  8:23     ` Jan Beulich
2009-12-08  8:23     ` Jan Beulich
2009-12-08  8:29     ` Tejun Heo
2009-12-08  8:29       ` Tejun Heo
2009-12-08  8:29       ` Tejun Heo
2009-12-08  8:39       ` Jan Beulich
2009-12-08  8:39         ` Jan Beulich
2009-12-08  8:57         ` Tejun Heo
2009-12-08  8:57           ` Tejun Heo
2009-12-08  8:57           ` Tejun Heo
2009-12-09 23:43           ` [PATCH -stable] vmalloc: conditionalize build of pcpu_get_vm_areas() Tejun Heo
2009-12-09 23:43             ` Tejun Heo
2009-12-09 23:43             ` Tejun Heo
2009-12-16 23:12             ` [stable] [PATCH -stable] vmalloc: conditionalize build of Greg KH
2009-12-16 23:12               ` [stable] [PATCH -stable] vmalloc: conditionalize build of pcpu_get_vm_areas() Greg KH
2009-12-16 23:12               ` Greg KH
2009-12-16 23:59               ` Tejun Heo
2009-12-17  0:01                 ` Tejun Heo
2009-12-17  0:01                 ` Tejun Heo
2009-12-17  0:02                 ` [stable] [PATCH -stable] vmalloc: conditionalize build of Greg KH
2009-12-17  0:02                   ` [stable] [PATCH -stable] vmalloc: conditionalize build of pcpu_get_vm_areas() Greg KH
2009-12-17  0:02                   ` Greg KH
2009-12-09 17:31     ` [PATCH] mm/vmalloc: don't use vmalloc_end Christoph Lameter
2009-12-09 17:31       ` Christoph Lameter
2009-12-09 17:31       ` Christoph Lameter
2009-12-09 17:48       ` Luck, Tony
2009-12-09 17:48         ` Luck, Tony
2009-12-09 17:48         ` Luck, Tony
2009-12-09 18:10       ` Mike Travis
2009-12-09 18:10         ` Mike Travis
2009-12-09 18:10         ` Mike Travis
2009-12-09 18:23         ` Christoph Lameter
2009-12-09 18:23           ` Christoph Lameter
2009-12-09 18:23           ` Christoph Lameter
2009-12-09 18:24           ` Christoph Lameter
2009-12-09 18:24             ` Christoph Lameter
2009-12-09 18:24             ` Christoph Lameter
2009-12-09 18:37           ` Mike Travis
2009-12-09 18:37             ` Mike Travis
2009-12-09 18:37             ` Mike Travis
2009-12-09 18:46             ` Christoph Lameter
2009-12-09 18:46               ` Christoph Lameter
2009-12-09 18:46               ` Christoph Lameter
2009-12-08  9:11   ` Geert Uytterhoeven
2009-12-08  9:11     ` Geert Uytterhoeven
2009-12-08  9:11     ` Geert Uytterhoeven
2009-12-08  9:24     ` Tejun Heo
2009-12-08  9:24       ` Tejun Heo
2009-12-08  9:24       ` Tejun Heo
2009-12-09  8:47       ` [PATCH] m68k: rename global variable vmalloc_end to m68k_vmalloc_end Tejun Heo
2009-12-09  8:47         ` Tejun Heo
2009-12-09  8:47         ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091207153552.0fadf335.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=JBeulich@novell.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.