Skip to content

Commit

Permalink
Merge tag 'slab-fixes-for-6.6-rc6' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/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()
  • Loading branch information
Linus Torvalds committed Oct 19, 2023
2 parents 189b756 + c15cdea commit 54fb58a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54fb58a

Please sign in to comment.