diff options
author | Christoph Lameter <cl@linux.com> | 2011-06-14 17:16:36 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2011-06-16 12:40:20 -0400 |
commit | 3192b920bf7d0c528ab54e7d3689f44055316a37 (patch) | |
tree | f907471f606a17cef0c1af4bc2187cdd4ee26c64 /include/linux/slab_def.h | |
parent | bd50cfa89153a67429935a15e577a5eb5f10dd1b (diff) |
slab, slub, slob: Unify alignment definition
Every slab has its on alignment definition in include/linux/sl?b_def.h. Extract those
and define a common set in include/linux/slab.h.
SLOB: As notes sometimes we need double word alignment on 32 bit. This gives all
structures allocated by SLOB a unsigned long long alignment like the others do.
SLAB: If ARCH_SLAB_MINALIGN is not set SLAB would set ARCH_SLAB_MINALIGN to
zero meaning no alignment at all. Give it the default unsigned long long alignment.
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux/slab_def.h')
-rw-r--r-- | include/linux/slab_def.h | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 83203ae9390b..d7f63112f63c 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -18,32 +18,6 @@ | |||
18 | #include <trace/events/kmem.h> | 18 | #include <trace/events/kmem.h> |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Enforce a minimum alignment for the kmalloc caches. | ||
22 | * Usually, the kmalloc caches are cache_line_size() aligned, except when | ||
23 | * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned. | ||
24 | * Some archs want to perform DMA into kmalloc caches and need a guaranteed | ||
25 | * alignment larger than the alignment of a 64-bit integer. | ||
26 | * ARCH_KMALLOC_MINALIGN allows that. | ||
27 | * Note that increasing this value may disable some debug features. | ||
28 | */ | ||
29 | #ifdef ARCH_DMA_MINALIGN | ||
30 | #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN | ||
31 | #else | ||
32 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) | ||
33 | #endif | ||
34 | |||
35 | #ifndef ARCH_SLAB_MINALIGN | ||
36 | /* | ||
37 | * Enforce a minimum alignment for all caches. | ||
38 | * Intended for archs that get misalignment faults even for BYTES_PER_WORD | ||
39 | * aligned buffers. Includes ARCH_KMALLOC_MINALIGN. | ||
40 | * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables | ||
41 | * some debug features. | ||
42 | */ | ||
43 | #define ARCH_SLAB_MINALIGN 0 | ||
44 | #endif | ||
45 | |||
46 | /* | ||
47 | * struct kmem_cache | 21 | * struct kmem_cache |
48 | * | 22 | * |
49 | * manages a cache. | 23 | * manages a cache. |