From: sxwjean@me.com
To: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com,
keescook@chromium.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org,
Xiongwei Song <xiongwei.song@windriver.com>
Subject: [PATCH 2/5] slub: Put objects_show() into CONFIG_SLUB_DEBUG enabled block
Date: Thu, 13 Apr 2023 22:34:49 +0800 [thread overview]
Message-ID: <20230413143452.211250-3-sxwjean@me.com> (raw)
In-Reply-To: <20230413143452.211250-1-sxwjean@me.com>
From: Xiongwei Song <xiongwei.song@windriver.com>
The SO_ALL|SO_OBJECTS pair is only used when enabling CONFIG_SLUB_DEBUG
option, so the objects_show() definition should be surrounded by
CONFIG_SLUB_DEBUG too.
Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
---
mm/slub.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 5cc56f780241..b8afe12ebba1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5613,12 +5613,6 @@ static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf)
}
SLAB_ATTR_RO(cpu_slabs);
-static ssize_t objects_show(struct kmem_cache *s, char *buf)
-{
- return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS);
-}
-SLAB_ATTR_RO(objects);
-
static ssize_t objects_partial_show(struct kmem_cache *s, char *buf)
{
return show_slab_objects(s, buf, SO_PARTIAL|SO_OBJECTS);
@@ -5713,6 +5707,12 @@ static ssize_t total_objects_show(struct kmem_cache *s, char *buf)
}
SLAB_ATTR_RO(total_objects);
+static ssize_t objects_show(struct kmem_cache *s, char *buf)
+{
+ return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS);
+}
+SLAB_ATTR_RO(objects);
+
static ssize_t sanity_checks_show(struct kmem_cache *s, char *buf)
{
return sysfs_emit(buf, "%d\n", !!(s->flags & SLAB_CONSISTENCY_CHECKS));
--
2.30.2
next prev parent reply other threads:[~2023-04-13 14:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 14:34 [PATCH 0/5] Some tiny clean ups for SLUB sxwjean
2023-04-13 14:34 ` [PATCH 1/5] slub: Correct the error code when slab_kset is NULL sxwjean
2023-04-13 14:34 ` sxwjean [this message]
2023-04-13 17:53 ` [PATCH 2/5] slub: Put objects_show() into CONFIG_SLUB_DEBUG enabled block kernel test robot
2023-04-17 7:12 ` Song, Xiongwei
2023-04-13 14:34 ` [PATCH 3/5] slub: Remove CONFIG_SMP defined check sxwjean
2023-04-13 14:34 ` [PATCH 4/5] slub: Remove slabs_node() function sxwjean
2023-04-13 14:34 ` [PATCH 5/5] slub: Don't read nr_slabs and total_objects directly sxwjean
2023-04-18 7:50 ` [PATCH 0/5] Some tiny clean ups for SLUB Vlastimil Babka
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=20230413143452.211250-3-sxwjean@me.com \
--to=sxwjean@me.com \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
--cc=xiongwei.song@windriver.com \
/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