From: sxwjean@me.com
To: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, vbabka@suse.cz, roman.gushchin@linux.dev,
42.hyeyoo@gmail.com
Cc: corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] mm/slab: remove slab_nomrege and slab_merge
Date: Mon, 20 Nov 2023 17:12:12 +0800 [thread overview]
Message-ID: <20231120091214.150502-3-sxwjean@me.com> (raw)
In-Reply-To: <20231120091214.150502-1-sxwjean@me.com>
From: Xiongwei Song <xiongwei.song@windriver.com>
Since slab allocatoer has already been removed, so we should also remove
the related parameters. And change the global flag from slab_nomerge
to slub_nomerge.
Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
---
Documentation/admin-guide/kernel-parameters.txt | 11 ++---------
mm/Kconfig | 2 +-
mm/slab_common.c | 13 +++++--------
3 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index c7709a11f8ce..afca9ff7c9f0 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -5870,11 +5870,11 @@
slram= [HW,MTD]
- slab_merge [MM]
+ slub_merge [MM]
Enable merging of slabs with similar size when the
kernel is built without CONFIG_SLAB_MERGE_DEFAULT.
- slab_nomerge [MM]
+ slub_nomerge [MM]
Disable merging of slabs with similar size. May be
necessary if there is some reason to distinguish
allocs to different slabs, especially in hardened
@@ -5915,13 +5915,6 @@
lower than slub_max_order.
For more information see Documentation/mm/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.
-
smart2= [HW]
Format: <io1>[,<io2>[,...,<io8>]]
diff --git a/mm/Kconfig b/mm/Kconfig
index 766aa8f8e553..87c3f2e1d0d3 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -255,7 +255,7 @@ config SLAB_MERGE_DEFAULT
cache layout), which makes such heap attacks easier to exploit
by attackers. By keeping caches unmerged, these kinds of exploits
can usually only damage objects in the same cache. To disable
- merging at runtime, "slab_nomerge" can be passed on the kernel
+ merging at runtime, "slub_nomerge" can be passed on the kernel
command line.
config SLAB_FREELIST_RANDOM
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 238293b1dbe1..d707abd31926 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -58,26 +58,23 @@ static DECLARE_WORK(slab_caches_to_rcu_destroy_work,
/*
* Merge control. If this is set then no merging of slab caches will occur.
*/
-static bool slab_nomerge = !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT);
+static bool slub_nomerge = !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT);
static int __init setup_slab_nomerge(char *str)
{
- slab_nomerge = true;
+ slub_nomerge = true;
return 1;
}
static int __init setup_slab_merge(char *str)
{
- slab_nomerge = false;
+ slub_nomerge = false;
return 1;
}
__setup_param("slub_nomerge", slub_nomerge, setup_slab_nomerge, 0);
__setup_param("slub_merge", slub_merge, setup_slab_merge, 0);
-__setup("slab_nomerge", setup_slab_nomerge);
-__setup("slab_merge", setup_slab_merge);
-
/*
* Determine the size of a slab object
*/
@@ -138,7 +135,7 @@ static unsigned int calculate_alignment(slab_flags_t flags,
*/
int slab_unmergeable(struct kmem_cache *s)
{
- if (slab_nomerge || (s->flags & SLAB_NEVER_MERGE))
+ if (slub_nomerge || (s->flags & SLAB_NEVER_MERGE))
return 1;
if (s->ctor)
@@ -163,7 +160,7 @@ struct kmem_cache *find_mergeable(unsigned int size, unsigned int align,
{
struct kmem_cache *s;
- if (slab_nomerge)
+ if (slub_nomerge)
return NULL;
if (ctor)
--
2.34.1
next prev parent reply other threads:[~2023-11-20 9:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-20 9:12 [PATCH 0/4] supplement of slab removal sxwjean
2023-11-20 9:12 ` [PATCH 1/4] Documentation: kernel-parameters: remove slab_max_order sxwjean
2023-11-21 8:30 ` Hyeonggon Yoo
2023-11-22 5:19 ` Song, Xiongwei
2023-11-20 9:12 ` sxwjean [this message]
2023-11-21 8:44 ` [PATCH 2/4] mm/slab: remove slab_nomrege and slab_merge Hyeonggon Yoo
2023-11-22 5:27 ` Song, Xiongwei
2023-11-22 5:59 ` Hyeonggon Yoo
2023-11-20 9:12 ` [PATCH 3/4] mm/slab: make calculate_alignment() public sxwjean
2023-11-20 9:12 ` [PATCH 4/4] mm/slab: move slab merge from slab_common.c to slub.c sxwjean
2023-11-21 8:54 ` Hyeonggon Yoo
2023-11-21 10:03 ` Vlastimil Babka
2023-11-22 5:29 ` Song, Xiongwei
2023-11-21 9:01 ` Hyeonggon Yoo
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=20231120091214.150502-3-sxwjean@me.com \
--to=sxwjean@me.com \
--cc=42.hyeyoo@gmail.com \
--cc=cl@linux.com \
--cc=corbet@lwn.net \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
/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