From: Harry Yoo <harry.yoo@oracle.com>
To: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org, vbabka@suse.cz
Subject: Re: [PATCH] tools/mm/slabinfo: Fix trace disabling logic
Date: Mon, 8 Dec 2025 18:29:49 +0900 [thread overview]
Message-ID: <aTaajTO9QY4eSLR1@hyeyoo> (raw)
In-Reply-To: <20251208084255.2689901-1-kaushlendra.kumar@intel.com>
On Mon, Dec 08, 2025 at 02:12:55PM +0530, Kaushlendra Kumar wrote:
> When tracing is disabled (!tracing) but the slab has tracing enabled
> (s->trace), the code should disable tracing by writing 0, not enable
> it by writing 1. Fix the inverted logic to correctly turn off tracing.
>
> Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
> ---
After commit 060807f841ac9 ("mm, slub: make remaining slub_debug related
attributes read-only"), enabling or disabling debug option at runtime is
not supported anymore. slabinfo's -d and -dA flags are not supposed work on
recent kernels.
As it turns out enabling or disabling debug features at runtime is not a
good idea anyway, could you please working on dropping the feature instead?
> tools/mm/slabinfo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c
> index 80cdbd3db82d..7c51d283504d 100644
> --- a/tools/mm/slabinfo.c
> +++ b/tools/mm/slabinfo.c
> @@ -798,7 +798,7 @@ static void slab_debug(struct slabinfo *s)
> fprintf(stderr, "%s can only enable trace for one slab at a time\n", s->name);
> }
> if (!tracing && s->trace)
> - set_obj(s, "trace", 1);
> + set_obj(s, "trace", 0);
> }
>
> static void totals(void)
> --
> 2.34.1
--
Cheers,
Harry / Hyeonggon
next prev parent reply other threads:[~2025-12-08 9:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 8:42 Kaushlendra Kumar
2025-12-08 9:29 ` Harry Yoo [this message]
2025-12-08 12:25 ` Kumar, Kaushlendra
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=aTaajTO9QY4eSLR1@hyeyoo \
--to=harry.yoo@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=kaushlendra.kumar@intel.com \
--cc=linux-mm@kvack.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