aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2011-06-23 10:36:12 -0400
committerPekka Enberg <penberg@kernel.org>2011-07-07 14:04:12 -0400
commit90810645f78f894acfb04b3768e8a7d45f2b303a (patch)
tree114dce690d2f74cdb347e68d1386c605cdeee093 /include/linux/slab.h
parent3192b920bf7d0c528ab54e7d3689f44055316a37 (diff)
slab allocators: Provide generic description of alignment defines
Provide description for alignment defines. Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 646a639a4aae..573c809c33d9 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -133,12 +133,22 @@ unsigned int kmem_cache_size(struct kmem_cache *);
133#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH) 133#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH)
134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) 134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
135 135
136/*
137 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
138 * alignment larger than the alignment of a 64-bit integer.
139 * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
140 */
136#ifdef ARCH_DMA_MINALIGN 141#ifdef ARCH_DMA_MINALIGN
137#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN 142#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
138#else 143#else
139#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) 144#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
140#endif 145#endif
141 146
147/*
148 * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment.
149 * Intended for arches that get misalignment faults even for 64 bit integer
150 * aligned buffers.
151 */
142#ifndef ARCH_SLAB_MINALIGN 152#ifndef ARCH_SLAB_MINALIGN
143#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) 153#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
144#endif 154#endif