mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Yoo <harry@kernel.org>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Hao Li <hao.li@linux.dev>,  Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	 Roman Gushchin <roman.gushchin@linux.dev>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	 Conor Dooley <conor@kernel.org>,
	Damien Le Moal <dlemoal@kernel.org>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Alexander Potapenko <glider@google.com>,
	 Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	 Vincenzo Frascino <vincenzo.frascino@arm.com>,
	kasan-dev@googlegroups.com
Subject: Re: [PATCH v3 00/10] replace CONFIG_SLUB_TINY with a slab_tiny boot parameter
Date: Tue, 10 Nov 2026 15:46:49 +0100	[thread overview]
Message-ID: <avMspQZD7fyg4i2x@thinkstation> (raw)
In-Reply-To: <20261105-slub_tiny_rework-v3-0-0484ce59eabb@kernel.org>

Thanks. I think it'll be ready once the issues on patch 2 and 4 are
addressed. Could you please adjust in v4 and respin?

Also I think it's worth measuring impact on memory footprint of this
(SLUB_TINY before this series vs. slab_tiny after this series)
and put that in the cover letter.

On Thu, Nov 05, 2026 at 09:43:49AM +0100, Vlastimil Babka (SUSE) wrote:
> CONFIG_SLUB_TINY was introduced to help tiny systems migrate away from
> the SLOB implementation so it could be removed. Its main purpose has
> been to disable all forms of percpu object caching (cpu slabs back then,
> now sheaves), and being a compile-time config option, some extra minor
> saving were achieved by code elimination or more agressive merging of
> caches with reclaimable and non-reclaimable objects (keeping those
> separate helps reduce high-order page fragmentation but not memory
> footprint.
> 
> However being a config option brings issues such as incompatibility with
> other options that has caused troubles in the past and Linus argued for
> removing it [1]. Moreover, there is a use case for having full-blown
> scalable implementation enabled and being able to disable it with a
> boot-time rather than compile-time decision. That ise base is the kdump
> kernel which shares the same vmlinux but wants to minimize the memory
> overhead (which has to be pre-reserved from the production kernel) and
> does not mind reduced scalability.
> 
> Thus this series reworks the CONFIG_SLUB_TINY to be controlled by a
> variable set by a boot-time parameter. The config option itself is
> deprecated and only sets the default value of the variable, and all its
> interactions with other config options are removed.
> 
> The conversion builds mainly on the fact that most SLUB_TINY specific
> paths to avoiding percpu object caching are shared with slab_debug
> handling, except doing any actual debugging checks.
> 
> Thus introduce slab_debug=N (for No-op) option to allow using the
> slab_debug checks directly, and extract the underlying static key
> handling from CONFIG_SLUB_DEBUG only scope. The decision to create
> separate kmalloc-rcl caches is also made to be boot-time.
> 
> The parts of CONFIG_SLUB_TINY that can't be transformed to a boot-time
> decision are related to dead code elimination and fast path inlining,
> merging of non-kmalloc reclaimable and unreclaimable caches, an
> ignoring SLAB_NO_MERGE for performance purposes (currently used in
> networking). Those lost memory saving should be all relatively minor
> compared to the savings from avoiding percpu caching.
> 
> To sum up, after this series:
> 
> - CONFIG_SLUB_TINY is a deprecated option that has no interaction with
>   other options and only controls the default behavior.
> 
> - New slab_tiny boot parameter controls the functionality (and can
>   override CONFIG_SLUB_TINY in both directions).
> 
> - slab_debug=N can effectively achieve most of slab_tiny and on a
>   per-cache basic
> 
> - the implementation is simpler with many ifdefs removed
> 
> [1] https://lore.kernel.org/all/CAHk-=wh-k04MsoEC0SGKff2Snm6bBF_e+0pHOKwaWv4umZ_SnQ@mail.gmail.com/
> 
> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
> ---
>
> Changes in v3:
> - Rebase to v7.4-rc1
> - Add SLAB_DEBUG_NOOP to SLAB_MERGE_SAME (sashiko)
> - Prevent premature slab free in slab and kasan kunit tests by new
>   patches 1 and 2 (sashiko)
> - Link to v2: https://patch.msgid.link/20261024-slub_tiny_rework-v2-0-bf1419ab5ffd@kernel.org
> 
> Changes in v2:
> - Rebase to current mainline (with slab/for-7.4 merged)
> - Stop triggering nohash pointers due to slab_debug=N (Harry)
> - Stop preventing slab merging dues to SLAB_DEBUG_NOOP (Harry)
> - Link to v1: https://patch.msgid.link/20260923-slub_tiny_rework-v1-0-a0e66d536eb5@kernel.org
> 
> ---
> Vlastimil Babka (SUSE) (10):
>       slab, kunit: pin test slabs by an extra allocation
>       kasan, kunit: pin test slabs by an extra allocation
>       mm, slab: refactor slab_min/max_order handling
>       mm, slab: introduce slab_debug=N
>       mm, slab: rework KMALLOC_RECLAIM handling of SLUB_TINY
>       mm, slab: make SLUB_TINY handling dynamic for sizing decisions
>       mm, slab: convert CONFIG_SLUB_TINY checks to kmem_cache_debug()
>       mm, slab: remove remaining compile-time checks for CONFIG_SLUB_TINY
>       mm, slab: add slab_tiny boot param
>       mm, slab: deprecate CONFIG_SLUB_TINY and reduce its Kconfig effects
> 
>  Documentation/admin-guide/kernel-parameters.txt |   4 +
>  Documentation/admin-guide/mm/slab.rst           |  18 ++-
>  include/linux/slab.h                            |  17 +--
>  lib/Kconfig.kasan                               |   2 +-
>  lib/tests/slub_kunit.c                          |  36 ++++-
>  mm/Kconfig                                      |  16 +--
>  mm/Kconfig.debug                                |   2 +-
>  mm/kasan/kasan_test_c.c                         |  24 +++-
>  mm/slab.h                                       |  32 ++---
>  mm/slab_common.c                                |  21 +--
>  mm/slub.c                                       | 167 ++++++++++++------------
>  11 files changed, 195 insertions(+), 144 deletions(-)
> ---
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> change-id: 20260911-slub_tiny_rework-8f2634dd17a7
> 

-- 
Cheers,
Harry / Hyeonggon

      parent reply	other threads:[~2026-11-10 14:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  8:43 Vlastimil Babka (SUSE)
2026-11-05  8:43 ` [PATCH v3 01/10] slab, kunit: pin test slabs by an extra allocation Vlastimil Babka (SUSE)
2026-11-05 12:59   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 02/10] kasan, " Vlastimil Babka (SUSE)
2026-11-05 13:03   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 03/10] mm, slab: refactor slab_min/max_order handling Vlastimil Babka (SUSE)
2026-11-05 13:12   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 04/10] mm, slab: introduce slab_debug=N Vlastimil Babka (SUSE)
2026-11-05 14:30   ` Harry Yoo
2026-11-05 14:36     ` Vlastimil Babka (SUSE)
2026-11-05 15:02       ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 05/10] mm, slab: rework KMALLOC_RECLAIM handling of SLUB_TINY Vlastimil Babka (SUSE)
2026-11-08 17:00   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 06/10] mm, slab: make SLUB_TINY handling dynamic for sizing decisions Vlastimil Babka (SUSE)
2026-11-08 17:58   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 07/10] mm, slab: convert CONFIG_SLUB_TINY checks to kmem_cache_debug() Vlastimil Babka (SUSE)
2026-11-10 14:12   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 08/10] mm, slab: remove remaining compile-time checks for CONFIG_SLUB_TINY Vlastimil Babka (SUSE)
2026-11-10 14:19   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 09/10] mm, slab: add slab_tiny boot param Vlastimil Babka (SUSE)
2026-11-10 14:24   ` Harry Yoo
2026-11-05  8:43 ` [PATCH v3 10/10] mm, slab: deprecate CONFIG_SLUB_TINY and reduce its Kconfig effects Vlastimil Babka (SUSE)
2026-11-10 14:39   ` Harry Yoo
2026-11-10 14:46 ` Harry Yoo [this message]

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=avMspQZD7fyg4i2x@thinkstation \
    --to=harry@kernel.org \
    --cc=andreyknvl@gmail.com \
    --cc=cl@gentwo.org \
    --cc=conor@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=dvyukov@google.com \
    --cc=geert@linux-m68k.org \
    --cc=glider@google.com \
    --cc=hao.li@linux.dev \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=ryabinin.a.a@gmail.com \
    --cc=vbabka@kernel.org \
    --cc=vincenzo.frascino@arm.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

all inboxes | Powered by JetHome®