summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-10-19 10:53:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-10-19 10:53:31 -0700
commit54fb58aec47a49a80534d2ccabd319334d6b0ef8 (patch)
tree09b72d85280c563d3abbc4a97f32a4989f7e3c38
parent189b756271e69bb6b9dfe4703b7f74855ab201b4 (diff)
parentc15cdea517414e0b29a11e0a0e2443d127c9109b (diff)
Merge tag 'slab-fixes-for-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab
Pull slab fix from Vlastimil Babka: - stable fix to prevent kernel warnings with KASAN_HW_TAGS on arm64 due to improperly resolved kmalloc alignment restrictions (Catalin Marinas) * tag 'slab-fixes-for-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm: slab: Do not create kmalloc caches smaller than arch_slab_minalign()
-rw-r--r--mm/slab_common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 8fda308e400d..9bbffe82d65a 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -895,10 +895,13 @@ void __init setup_kmalloc_cache_index_table(void)
static unsigned int __kmalloc_minalign(void)
{
+ unsigned int minalign = dma_get_cache_alignment();
+
if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) &&
is_swiotlb_allocated())
- return ARCH_KMALLOC_MINALIGN;
- return dma_get_cache_alignment();
+ minalign = ARCH_KMALLOC_MINALIGN;
+
+ return max(minalign, arch_slab_minalign());
}
void __init