Skip to content

Commit

Permalink
mm/slab_common: provide "slab_merge" option for !IS_ENABLED(CONFIG_SL…
Browse files Browse the repository at this point in the history
…AB_MERGE_DEFAULT) builds

This is a minor addition to the allocator setup options to provide
a simple way to on demand enable back cache merging for builds
that by default run with CONFIG_SLAB_MERGE_DEFAULT not set.

Signed-off-by: Rafael Aquini <aquini@redhat.com>
  • Loading branch information
aquini authored and intel-lab-lkp committed Mar 19, 2021
1 parent 2932a9e commit d6cb752
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Expand Up @@ -4770,6 +4770,10 @@

slram= [HW,MTD]

slab_merge [MM]
Enable merging of slabs with similar size when the
kernel is built without CONFIG_SLAB_MERGE_DEFAULT.

slab_nomerge [MM]
Disable merging of slabs with similar size. May be
necessary if there is some reason to distinguish
Expand Down Expand Up @@ -4825,6 +4829,9 @@
lower than slub_max_order.
For more information see Documentation/vm/slub.rst.

slub_merge [MM, SLUB]
Same with slab_merge.

slub_nomerge [MM, SLUB]
Same with slab_nomerge. This is supported for legacy.
See slab_nomerge for more information.
Expand Down
8 changes: 8 additions & 0 deletions mm/slab_common.c
Expand Up @@ -69,11 +69,19 @@ static int __init setup_slab_nomerge(char *str)
return 1;
}

static int __init setup_slab_merge(char *str)
{
slab_nomerge = false;
return 1;
}

#ifdef CONFIG_SLUB
__setup_param("slub_nomerge", slub_nomerge, setup_slab_nomerge, 0);
__setup_param("slub_merge", slub_merge, setup_slab_merge, 0);
#endif

__setup("slab_nomerge", setup_slab_nomerge);
__setup("slab_merge", setup_slab_nomerge);

/*
* Determine the size of a slab object
Expand Down

0 comments on commit d6cb752

Please sign in to comment.