linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1 0/2] Only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches
@ 2026-01-27 10:31 Harry Yoo
  2026-01-27 10:31 ` [PATCH V1 1/2] mm/slab: factor out slab_args_unmergeable() Harry Yoo
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Harry Yoo @ 2026-01-27 10:31 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka
  Cc: Christoph Lameter, David Rientjes, Roman Gushchin, Muchun Song,
	Shakeel Butt, Michal Hocko, Yeoreum Yun, Johannes Weiner,
	Suren Baghdasaryan, Harry Yoo, Hai Li, linux-mm

While SLAB_OBJ_EXT_IN_OBJ allows to reduce memory overhead to account
slab objects, it prevents slab merging because merging can change
the metadata layout.

As pointed out Vlastimil Babka, disabling merging solely for this memory
optimization may not be a net win, because disabling slab merging tends
to increase overall memory usage.

So let's take a conservative approach and restrict SLAB_OBJ_EXT_IN_OBJ
to caches that are already unmergeable for other reasons.

Ideally this should be part of the slab/for-7.0/obj_metadata branch,
but due to a conflict with slab/for-7.0/sheaves, I based it on
slab/for-next (be36abd97e52).

Patch 1 factors out mergeability logic to slab_args_unmergeable().
This is used to determine mergeability before the cache is created.

Patch 2 uses the new function to allow SLAB_OBJ_EXT_IN_OBJ
only when merging is not allowed for other reasons.

Harry Yoo (2):
  mm/slab: factor out slab_args_unmergeable()
  mm/slab: only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches

 mm/slab.h        |  1 +
 mm/slab_common.c | 27 +++++++++++++++++----------
 mm/slub.c        |  3 ++-
 3 files changed, 20 insertions(+), 11 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-02-05  6:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-27 10:31 [PATCH V1 0/2] Only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches Harry Yoo
2026-01-27 10:31 ` [PATCH V1 1/2] mm/slab: factor out slab_args_unmergeable() Harry Yoo
2026-01-27 16:35   ` Vlastimil Babka
2026-01-27 16:42     ` Harry Yoo
2026-01-27 16:49       ` Vlastimil Babka
2026-01-27 10:31 ` [PATCH V1 2/2] mm/slab: only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches Harry Yoo
2026-02-03 11:56   ` Hao Li
2026-02-03 12:32     ` Harry Yoo
2026-02-04  0:45       ` Hao Li
2026-02-05  5:13         ` Harry Yoo
2026-02-05  6:27           ` Hao Li
2026-01-27 17:06 ` [PATCH V1 0/2] Only " Vlastimil Babka
2026-01-27 18:21 ` Johannes Weiner
2026-01-28  3:09   ` To enable, or not to enable slab merging? That is the question (was: Re: [PATCH V1 0/2] Only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches) Harry Yoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox