mm/kmemleak: disable KASAN instrumentation in kmemleak
authorWaiman Long <longman@redhat.com>
Thu, 7 Mar 2024 19:05:48 +0000 (14:05 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:05 +0000 (20:56 -0700)
Kmemleak ia a memory leak checker.  KASAN is also a memory checker but it
focuses more on finding out-of-bounds and use-after-free bugs.  Since
kmemleak is inherently slow especially on systems with large number of
CPUs, adding KASAN instrumentation will make it slower even more.  As
kmemleak is not for production use, the utility of enabling KASAN there is
questionable.

This patch disables KASAN instrumentation for configurations that enable
both of them to slightly reduce performance overhead.

Link: https://lkml.kernel.org/r/20240307190548.963626-3-longman@redhat.com
Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/Makefile

index 4abb40b911ec43c60cce7971ea69de9917f2c277..e164eed35d467d8070a2127c1027298978595da4 100644 (file)
@@ -5,6 +5,7 @@
 
 KASAN_SANITIZE_slab_common.o := n
 KASAN_SANITIZE_slub.o := n
+KASAN_SANITIZE_kmemleak.o := n
 KCSAN_SANITIZE_kmemleak.o := n
 
 # These produce frequent data race reports: most of them are due to races on