Skip to content

Only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches

Harry Yoo linux-mm 1 version Applied

Status from this message: Thanks, applied to slab/for-next and reorganized the sub-branches a bit to

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2mm/slab: factor out slab_args_unmergeable()mm/slab_common.c+18 -103 replies
2/2mm/slab: only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable cachesmm/slab.h mm/slab_common.c mm/slub.c+4 -35 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH V1 0/2] Only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches

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(-)
Signature · 1 line
2.43.0