Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Luiz Capitulino <luizcap@redhat.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Luiz Capitulino and committed by
Andrew Morton
0f428676 befbb254

+2 -2
+2 -2
mm/kmemleak.c
··· 210 210 static struct kmem_cache *scan_area_cache; 211 211 212 212 /* set if tracing memory operations is enabled */ 213 - static int kmemleak_enabled = 1; 213 + static int kmemleak_enabled __read_mostly = 1; 214 214 /* same as above but only for the kmemleak_free() callback */ 215 - static int kmemleak_free_enabled = 1; 215 + static int kmemleak_free_enabled __read_mostly = 1; 216 216 /* set in the late_initcall if there were no errors */ 217 217 static int kmemleak_late_initialized; 218 218 /* set if a fatal kmemleak error has occurred */