linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <teheo@novell.com>
To: stable@kernel.org
Cc: tony.luck@intel.com, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jan Beulich <JBeulich@novell.com>
Subject: [PATCH -stable] vmalloc: conditionalize build of pcpu_get_vm_areas()
Date: Thu, 10 Dec 2009 08:43:16 +0900	[thread overview]
Message-ID: <4B203614.1010907@novell.com> (raw)
In-Reply-To: <4B1E1513.3020000@kernel.org>

pcpu_get_vm_areas() is used only when dynamic percpu allocator is used
by the architecture.  In 2.6.32, ia64 doesn't use dynamic percpu
allocator and has a macro which makes pcpu_get_vm_areas() buggy via
local/global variable aliasing and triggers compile warning.

The problem is fixed in upstream and ia64 uses dynamic percpu
allocators, so the only left issue is inclusion of unnecessary code
and compile warning on ia64 on 2.6.32.

Don't build pcpu_get_vm_areas() if legacy percpu allocator is in use.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Jan Beulich <JBeulich@novell.com>
Cc: stable@kernel.org
---
Please note that this commit won't appear on upstream.

Thanks.

 include/linux/vmalloc.h |    2 ++
 mm/vmalloc.c            |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 227c2a5..3c123c3 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -115,9 +115,11 @@ extern rwlock_t vmlist_lock;
 extern struct vm_struct *vmlist;
 extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
 
+#ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA
 struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
 				     const size_t *sizes, int nr_vms,
 				     size_t align, gfp_t gfp_mask);
+#endif
 
 void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
 
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 0f551a4..7758726 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1993,6 +1993,7 @@ void free_vm_area(struct vm_struct *area)
 }
 EXPORT_SYMBOL_GPL(free_vm_area);
 
+#ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA
 static struct vmap_area *node_to_va(struct rb_node *n)
 {
 	return n ? rb_entry(n, struct vmap_area, rb_node) : NULL;
@@ -2257,6 +2258,7 @@ err_free:
 	kfree(vms);
 	return NULL;
 }
+#endif
 
 /**
  * pcpu_free_vm_areas - free vmalloc areas for percpu allocator

--
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-09 23:42 UTC|newest]

Thread overview: 26+ 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 23:35 ` Andrew Morton
2009-12-08  0:33   ` 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  9:08       ` Geert Uytterhoeven
2009-12-08  0:50   ` [PATCH] mm/vmalloc: don't use vmalloc_end Matthew Wilcox
2009-12-08  1:03     ` Andrew Morton
2009-12-08  8:23   ` Jan Beulich
2009-12-08  8:29     ` Tejun Heo
2009-12-08  8:39       ` Jan Beulich
2009-12-08  8:57         ` Tejun Heo
2009-12-09 23:43           ` Tejun Heo [this message]
2009-12-16 23:12             ` [stable] [PATCH -stable] vmalloc: conditionalize build of pcpu_get_vm_areas() Greg KH
2009-12-17  0:01               ` Tejun Heo
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:48       ` Luck, Tony
2009-12-09 18:10       ` Mike Travis
2009-12-09 18:23         ` Christoph Lameter
2009-12-09 18:24           ` Christoph Lameter
2009-12-09 18:37           ` Mike Travis
2009-12-09 18:46             ` Christoph Lameter
2009-12-08  9:11   ` Geert Uytterhoeven
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

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=4B203614.1010907@novell.com \
    --to=teheo@novell.com \
    --cc=JBeulich@novell.com \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox