Re: [PATCH] mm/slab: fix warning caused by duplicate kmem_cache creation in kmem_buckets_create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 05, 2024 at 12:08:37AM +0900, Koichiro Den wrote:
> Commit b035f5a6d852 ("mm: slab: reduce the kmalloc() minimum alignment
> if DMA bouncing possible") reduced ARCH_KMALLOC_MINALIGN to 8 on arm64.
> However, with KASAN_HW_TAGS enabled, arch_slab_minalign() becomes 16.
> This causes kmalloc_caches[*][8] to be aliased to kmalloc_caches[*][16],
> resulting in kmem_buckets_create() attempting to create a kmem_cache for
> size 16 twice. This duplication triggers warnings on boot:

Wouldn't this be easier?

+++ b/arch/arm64/include/asm/cache.h
@@ -33,7 +33,11 @@
  * the CPU.
  */
 #define ARCH_DMA_MINALIGN      (128)
+#ifdef CONFIG_KASAN_HW_TAGS
+#define ARCH_KMALLOC_MINALIGN  (16)
+#else
 #define ARCH_KMALLOC_MINALIGN  (8)
+#endif

 #ifndef __ASSEMBLY__






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux