Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Lameter and committed by
Pekka Enberg
90810645 3192b920

+10
+10
include/linux/slab.h
··· 133 133 #define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH) 134 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 141 #ifdef ARCH_DMA_MINALIGN 137 142 #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN 138 143 #else 139 144 #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) 140 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 152 #ifndef ARCH_SLAB_MINALIGN 143 153 #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) 144 154 #endif