r3882 - in trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian: .
patches patches/series
Simon Horman
horms at costa.debian.org
Mon Aug 15 09:53:26 UTC 2005
Author: horms
Date: 2005-08-15 09:53:25 +0000 (Mon, 15 Aug 2005)
New Revision: 3882
Added:
trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/module-per-cpu-alignment-fix.dpatch
Modified:
trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-17
Log:
* module-per-cpu-alignment-fix.dpatch
Module per-cpu alignment cannot always be met
From 2.6.12.5
Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog 2005-08-15 09:38:56 UTC (rev 3881)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog 2005-08-15 09:53:25 UTC (rev 3882)
@@ -199,8 +199,12 @@
Check input buffer size in zisofs
From 2.6.12.5
- -- Simon Horman <horms at debian.org> Mon, 15 Aug 2005 18:36:45 +0900
+ * module-per-cpu-alignment-fix.dpatch
+ Module per-cpu alignment cannot always be met
+ From 2.6.12.5
+ -- Simon Horman <horms at debian.org> Mon, 15 Aug 2005 18:51:34 +0900
+
kernel-source-2.6.8 (2.6.8-16) unstable; urgency=low
* smbfs-overrun.dpatch:
Added: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/module-per-cpu-alignment-fix.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/module-per-cpu-alignment-fix.dpatch 2005-08-15 09:38:56 UTC (rev 3881)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/module-per-cpu-alignment-fix.dpatch 2005-08-15 09:53:25 UTC (rev 3882)
@@ -0,0 +1,78 @@
+From stable-bounces at linux.kernel.org Wed Aug 10 05:52:08 2005
+Date: Wed, 10 Aug 2005 13:52:38 +0100
+From: Daniel Drake <dsd at gentoo.org>
+To: stable at kernel.org
+Cc: rusty at rustcorp.com.au
+Subject: [PATCH] Module per-cpu alignment cannot always be met
+
+From: Rusty Russell <rusty at rustcorp.com.au>
+
+Fwd from Daniel Drake <dsd at gentoo.org>.
+
+The module code assumes noone will ever ask for a per-cpu area more than
+SMP_CACHE_BYTES aligned. However, as these cases show, gcc asks sometimes
+asks for 32-byte alignment for the per-cpu section on a module, and if
+CONFIG_X86_L1_CACHE_SHIFT is 4, we hit that BUG_ON(). This is obviously an
+unusual combination, as there have been few reports, but better to warn
+than die.
+
+See:
+ http://www.ussg.iu.edu/hypermail/linux/kernel/0409.0/0768.html
+
+And more recently:
+ http://bugs.gentoo.org/show_bug.cgi?id=97006
+
+Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+Signed-off-by: Linus Torvalds <torvalds at osdl.org>
+Signed-off-by: Chris Wright <chrisw at osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+---
+ kernel/module.c | 15 +++++++++++----
+ 1 files changed, 11 insertions(+), 4 deletions(-)
+
+Index: linux-2.6.12.y/kernel/module.c
+===================================================================
+--- linux-2.6.12.y.orig/kernel/module.c
++++ linux-2.6.12.y/kernel/module.c
+@@ -249,13 +249,18 @@ static inline unsigned int block_size(in
+ /* Created by linker magic */
+ extern char __per_cpu_start[], __per_cpu_end[];
+
+-static void *percpu_modalloc(unsigned long size, unsigned long align)
++static void *percpu_modalloc(unsigned long size, unsigned long align,
++ const char *name)
+ {
+ unsigned long extra;
+ unsigned int i;
+ void *ptr;
+
+- BUG_ON(align > SMP_CACHE_BYTES);
++ if (align > SMP_CACHE_BYTES) {
++ printk(KERN_WARNING "%s: per-cpu alignment %li > %i\n",
++ name, align, SMP_CACHE_BYTES);
++ align = SMP_CACHE_BYTES;
++ }
+
+ ptr = __per_cpu_start;
+ for (i = 0; i < pcpu_num_used; ptr += block_size(pcpu_size[i]), i++) {
+@@ -347,7 +352,8 @@ static int percpu_modinit(void)
+ }
+ __initcall(percpu_modinit);
+ #else /* ... !CONFIG_SMP */
+-static inline void *percpu_modalloc(unsigned long size, unsigned long align)
++static inline void *percpu_modalloc(unsigned long size, unsigned long align,
++ const char *name)
+ {
+ return NULL;
+ }
+@@ -1554,7 +1560,8 @@ static struct module *load_module(void _
+ if (pcpuindex) {
+ /* We have a special allocation for this section. */
+ percpu = percpu_modalloc(sechdrs[pcpuindex].sh_size,
+- sechdrs[pcpuindex].sh_addralign);
++ sechdrs[pcpuindex].sh_addralign,
++ mod->name);
+ if (!percpu) {
+ err = -ENOMEM;
+ goto free_mod;
Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-17
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-17 2005-08-15 09:38:56 UTC (rev 3881)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/series/2.6.8-17 2005-08-15 09:53:25 UTC (rev 3882)
@@ -52,3 +52,4 @@
+ arch-x86_64-kernel-stack-faults.dpatch
+ linux-zlib-fixes.dpatch
+ zisofs.dpatch
++ module-per-cpu-alignment-fix.dpatch
More information about the Kernel-svn-changes
mailing list