Hello, On Mon, Dec 12, 2022 at 11:54:28AM +0100, Vlastimil Babka wrote: > On 11/27/22 12:05, Hyeonggon Yoo wrote: > > On Mon, Nov 21, 2022 at 06:12:00PM +0100, Vlastimil Babka wrote: > >> SLUB gets most of its scalability by percpu slabs. However for > >> CONFIG_SLUB_TINY the goal is minimal memory overhead, not scalability. > >> Thus, #ifdef out the whole kmem_cache_cpu percpu structure and > >> associated code. Additionally to the slab page savings, this reduces > >> percpu allocator usage, and code size. > > > > [+Cc Dennis] > > +To: Baoquan also. > > > Wondering if we can reduce (or zero) early reservation of percpu area > > when #if !defined(CONFIG_SLUB) || defined(CONFIG_SLUB_TINY)? > > Good point. I've sent a PR as it was [1], but (if merged) we can still > improve that during RC series, if it means more memory saved thanks to less > percpu usage with CONFIG_SLUB_TINY. > > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git/tag/?h=slab-for-6.2-rc1 The early reservation area not used at boot is then used to serve normal percpu allocations. Percpu allocates additional chunks based on a free page float count and is backed page by page, not all at once. I get slabs is the main motivator of early reservation, but if there are other users of percpu, then shrinking the early reservation area is a bit moot. Thanks, Dennis > > >> This change builds on recent commit c7323a5ad078 ("mm/slub: restrict > >> sysfs validation to debug caches and make it safe"), as caches with > >> enabled debugging also avoid percpu slabs and all allocations and > >> freeing ends up working with the partial list. With a bit more > >> refactoring by the preceding patches, use the same code paths with > >> CONFIG_SLUB_TINY. > >> > >> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> > > >