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

From: Vlastimil Babka (SUSE)

Date: Thu May 28 2026 - 04:01:46 EST


On 5/27/26 22:06, Andrew Morton wrote:
> On Wed, 27 May 2026 06:46:34 -0400 lirongqing <lirongqing@xxxxxxxxx> wrote:
>
>> Replace the #ifdef CONFIG_SLUB_DEBUG_ON conditional compilation with a
>> static key (mempool_debug_enabled). This allows enabling mempool debugging
>> at boot time via:
>>
>> mempool_debug
>>
>> Instead of requiring CONFIG_SLUB_DEBUG_ON at compile time. Benefits:
>
> Sashiko is suggesting that we use mempool_debug=<...> here. Which permits
> mempool_debug=n if for some reason the kernel is defaulting to "on". Which
> we might choose to do in the future. I think that's a little better - do others agree?

Yeah we could do that. But I still think "CONFIG_SLUB_DEBUG_ON" isn't what
should cause mempool_debug to default to "on". It can be revisited once
there's a solid argument why default on would be needed.

> Same goes for the new dmapool_debug.

Ack.

> Sashiko asked a second question:
> https://sashiko.dev/#/patchset/20260527104634.2434-1-lirongqing@xxxxxxxxx

Seems the same thing as Usama raised about static key init ordering.