Re: [PATCH] slab: remove the SLUB_DEBUG functionality and config option

From: David Hildenbrand (Arm)

Date: Wed Apr 01 2026 - 07:10:53 EST


On 4/1/26 12:59, Vlastimil Babka (SUSE) wrote:
> The boot-time enabled per-cache debugging has served us well in the
> past, but it's time for it to go, for the following reasons.
>
> - It's a debugging feature. However, thanks to the advent of LLM-based
> reviews, we are not adding bugs to the kernel anymore, so it's
> unnecessary now.

Right, and probably LLM review would find many of bugs in the existing
SLUB_DEBUG code.

>
> - KASAN is more powerful anyway for the classes of bugs that SLUB_DEBUG
> can catch. But I suspect KASAN is likely to be removed soon too, see
> above.

Of course.

>
> - SLAB never had no such dynamic debugging functionality. With the
> introduction of sheaves percpu caching, we have turned SLUB back into
> SLAB partially, so this just follows that direction.
>
> - It's removing ~2500 lines of code and I want to keep my overal
> diffstats negative. This adds a nice margin.

Personal stats clearly matter more than anything else.

>
> Since the slub kunit test depends on SLUB_DEBUG, remove it too. It's not
> a big loss, see the first point above.
>
> Singed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---
> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---
> lib/Kconfig.debug | 12 -
> lib/Kconfig.kasan | 2 -
> lib/tests/Makefile | 1 -
> lib/tests/slub_kunit.c | 329 --------
> mm/Kconfig.debug | 60 --
> mm/dmapool.c | 4 -
> mm/memcontrol-v1.c | 17 -
> mm/mempool.c | 105 ---
> mm/slab.h | 34 -
> mm/slub.c | 2074 +-----------------------------------------------

slab.h vs. slub.c is annoying.

Can you just rename that to sheaf.c / sheaf.h now while at it?

--
Cheers,

David