summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2011-06-02 10:19:41 -0400
committerPekka Enberg <penberg@kernel.org>2011-06-03 19:33:49 +0300
commitd4d84fef6d0366b585b7de13527a0faeca84d9ce (patch)
treec67449976f955cff4a2fe8a74affc2dd67c37b7e /include/linux
parent55922c9d1b84b89cb946c777fddccb3247e7df2c (diff)
slub: always align cpu_slab to honor cmpxchg_double requirement
On an architecture without CMPXCHG_LOCAL but with DEBUG_VM enabled, the VM_BUG_ON() in __pcpu_double_call_return_bool() will cause an early panic during boot unless we always align cpu_slab properly. In principle we could remove the alignment-testing VM_BUG_ON() for architectures that don't have CMPXCHG_LOCAL, but leaving it in means that new code will tend not to break x86 even if it is introduced on another platform, and it's low cost to require alignment. Acked-by: David Rientjes <rientjes@google.com> Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/percpu.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 8b97308e65d..9ca008f0c54 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -259,6 +259,9 @@ extern void __bad_size_call_parameter(void);
* Special handling for cmpxchg_double. cmpxchg_double is passed two
* percpu variables. The first has to be aligned to a double word
* boundary and the second has to follow directly thereafter.
+ * We enforce this on all architectures even if they don't support
+ * a double cmpxchg instruction, since it's a cheap requirement, and it
+ * avoids breaking the requirement for architectures with the instruction.
*/
#define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \
({ \