答复: [????] Re: [PATCH] mm/mempool: use static key for boot-time debug enablement

From: Li,Rongqing(ACG CCN)

Date: Thu May 28 2026 - 04:05:42 EST


> > > > Please clean this mess up.
> > >
> > > Isn't that what this patch does?
> >
> > Its not marked as fixing something nor as addressing the weirdness of
> > using CONFIG_SLUB_DEBUG_ON here, A kernel build with
> > CONFIG_SLUB_DEBUG_ON can still boot without debugging if a certain
> > kernel command line option is given.
>
> Right, but ... if you look at what the patch _does_, doesn't it do what you're
> asking for it to do?

Hi Matthew, Christoph,

Matthew, thanks a lot for standing up for the code logic! I really appreciate your support
on this.

Christoph, thank you for pointing out the semantic gaps. To address your concerns,
I have completely rewritten the commit message to focus strictly on untangling
the CONFIG_SLUB_DEBUG_ON abuse and switching to mempool's own runtime parameter.

Here is the revised commit message:

---
mm/mempool: Untangle CONFIG_SLUB_DEBUG_ON abuse and switch to static key

The mempool subsystem historically wrapped its debugging logic inside an
#ifdef CONFIG_SLUB_DEBUG_ON block. This abused the config's intent (which
merely defines compile-time defaults for SLUB) and caused two flaws:

1. On production kernels where CONFIG_SLUB_DEBUG=y but CONFIG_SLUB_DEBUG_ON=n,
mempool debugging was completely truncated at compile time.
2. On kernels with CONFIG_SLUB_DEBUG_ON=y, mempool debugging stayed active
even if a user explicitly disabled debugging at boot time.

Clean up this mess by removing the #ifdef and switching to a runtime static
key (mempool_debug_enabled), allowing mempool debugging to be toggled cleanly
via its own boot parameter.

Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>
---

Does this revised text look good to you? If so, I will officially send out V2.

Thanks,

[Li,Rongqing]