From: Luiz Capitulino <luizcap@redhat.com>
To: catalin.marinas@arm.com
Cc: lcapitulino@gmail.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, david@redhat.com
Subject: [PATCH 3/3] mm: kmemleak: mark variables as __read_mostly
Date: Wed, 30 Apr 2025 16:59:47 -0400 [thread overview]
Message-ID: <4016090e857e8c4c2ade4b20df312f7f38325c15.1746046744.git.luizcap@redhat.com> (raw)
In-Reply-To: <cover.1746046744.git.luizcap@redhat.com>
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.
Signed-off-by: Luiz Capitulino <luizcap@redhat.com>
---
mm/kmemleak.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 06baa3475252..da9cee34ee1b 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -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 */
--
2.49.0
next prev parent reply other threads:[~2025-04-30 21:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 20:59 [PATCH 0/3] mm: kmemleak: small cleanup Luiz Capitulino
2025-04-30 20:59 ` [PATCH 1/3] mm: kmemleak: drop kmemleak_warning variable Luiz Capitulino
2025-05-01 10:39 ` Catalin Marinas
2025-04-30 20:59 ` [PATCH 2/3] mm: kmemleak: drop wrong comment Luiz Capitulino
2025-05-01 10:40 ` Catalin Marinas
2025-04-30 20:59 ` Luiz Capitulino [this message]
2025-05-01 10:42 ` [PATCH 3/3] mm: kmemleak: mark variables as __read_mostly Catalin Marinas
2025-04-30 21:06 ` [PATCH 0/3] mm: kmemleak: small cleanup David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4016090e857e8c4c2ade4b20df312f7f38325c15.1746046744.git.luizcap@redhat.com \
--to=luizcap@redhat.com \
--cc=catalin.marinas@arm.com \
--cc=david@redhat.com \
--cc=lcapitulino@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox