Commit 0f428676 authored by Luiz Capitulino's avatar Luiz Capitulino Committed by Andrew Morton
Browse files

mm: kmemleak: mark variables as __read_mostly

The variables kmemleak_enabled and kmemleak_free_enabled are read in the
kmemleak alloc and free path respectively, but are only written to if/when
kmemleak is disabled.

Link: https://lkml.kernel.org/r/4016090e857e8c4c2ade4b20df312f7f38325c15.1746046744.git.luizcap@redhat.com


Signed-off-by: default avatarLuiz Capitulino <luizcap@redhat.com>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent befbb254
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -210,9 +210,9 @@ static struct kmem_cache *object_cache;
static struct kmem_cache *scan_area_cache;

/* set if tracing memory operations is enabled */
static int kmemleak_enabled = 1;
static int kmemleak_enabled __read_mostly = 1;
/* same as above but only for the kmemleak_free() callback */
static int kmemleak_free_enabled = 1;
static int kmemleak_free_enabled __read_mostly = 1;
/* set in the late_initcall if there were no errors */
static int kmemleak_late_initialized;
/* set if a fatal kmemleak error has occurred */