diff options
Diffstat (limited to 'include/linux/slab_def.h')
| -rw-r--r-- | include/linux/slab_def.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index ca6b2b317991..791a502f6906 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -14,7 +14,34 @@ | |||
| 14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ | 14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ |
| 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ | 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ |
| 16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 17 | #include <linux/kmemtrace.h> | 17 | |
| 18 | #include <trace/events/kmem.h> | ||
| 19 | |||
| 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 | ||
| 18 | 45 | ||
| 19 | /* | 46 | /* |
| 20 | * struct kmem_cache | 47 | * struct kmem_cache |
