From: thunder.leizhen@huaweicloud.com
To: Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Roman Gushchin <roman.gushchin@linux.dev>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>,
linux-mm@kvack.org, "Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <quic_neeraju@quicinc.com>,
Joel Fernandes <joel@joelfernandes.org>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun.feng@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang1211@gmail.com>,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
openeuler <kernel@openeuler.org>
Subject: [PATCH v3 1/2] mm: Provide empty function for kmem_dump_obj() when CONFIG_PRINTK=n
Date: Wed, 2 Aug 2023 11:45:16 +0800 [thread overview]
Message-ID: <20230802034518.1115-2-thunder.leizhen@huaweicloud.com> (raw)
In-Reply-To: <20230802034518.1115-1-thunder.leizhen@huaweicloud.com>
From: Zhen Lei <thunder.leizhen@huawei.com>
Commit 5bb1bb353cfe ("mm: Don't build mm_dump_obj() on CONFIG_PRINTK=n
kernels") only provides static inline empty function for mem_dump_obj().
But functions kmem_valid_obj() and kmem_dump_obj() are also exported,
they may be called by functions other than mem_dump_obj(), so their empty
functions should also be provided when CONFIG_PRINTK=n.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
include/linux/slab.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 848c7c82ad5ad0b..fc05fe288d176b4 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -246,6 +246,9 @@ size_t ksize(const void *objp);
#ifdef CONFIG_PRINTK
bool kmem_valid_obj(void *object);
void kmem_dump_obj(void *object);
+#else
+static inline bool kmem_valid_obj(void *object) { return false; }
+static inline void kmem_dump_obj(void *object) {}
#endif
/*
--
2.34.1
next prev parent reply other threads:[~2023-08-02 3:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 3:45 [PATCH v3 0/2] rcu: Dump memory object info if callback function is invalid thunder.leizhen
2023-08-02 3:45 ` thunder.leizhen [this message]
2023-08-02 3:57 ` [PATCH v3 1/2] mm: Provide empty function for kmem_dump_obj() when CONFIG_PRINTK=n Matthew Wilcox
2023-08-02 11:11 ` Leizhen (ThunderTown)
2023-08-02 3:45 ` [PATCH v3 2/2] rcu: Dump memory object info if callback function is invalid thunder.leizhen
2023-08-02 3:48 ` Matthew Wilcox
2023-08-02 11:12 ` Leizhen (ThunderTown)
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=20230802034518.1115-2-thunder.leizhen@huaweicloud.com \
--to=thunder.leizhen@huaweicloud.com \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=boqun.feng@gmail.com \
--cc=cl@linux.com \
--cc=frederic@kernel.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=kernel@openeuler.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=penberg@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=quic_neeraju@quicinc.com \
--cc=rcu@vger.kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=vbabka@suse.cz \
/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