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 3/4] mm/slab: make calculate_alignment() public
Date: Mon, 20 Nov 2023 17:12:13 +0800 [thread overview]
Message-ID: <20231120091214.150502-4-sxwjean@me.com> (raw)
In-Reply-To: <20231120091214.150502-1-sxwjean@me.com>
From: Xiongwei Song <xiongwei.song@windriver.com>
We are going to move slab merge from slab_common.c to slub.c, there is a
call with it in find_mergeable(), so make it public.
Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com>
---
mm/slab.h | 2 ++
mm/slab_common.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/slab.h b/mm/slab.h
index eb04c8a5dbd1..8d20f8c6269d 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -427,6 +427,8 @@ extern void create_boot_cache(struct kmem_cache *, const char *name,
unsigned int size, slab_flags_t flags,
unsigned int useroffset, unsigned int usersize);
+unsigned int calculate_alignment(slab_flags_t flags,
+ unsigned int align, unsigned int size);
int slab_unmergeable(struct kmem_cache *s);
struct kmem_cache *find_mergeable(unsigned size, unsigned align,
slab_flags_t flags, const char *name, void (*ctor)(void *));
diff --git a/mm/slab_common.c b/mm/slab_common.c
index d707abd31926..62eb77fdedf2 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -106,7 +106,7 @@ static inline int kmem_cache_sanity_check(const char *name, unsigned int size)
* Figure out what the alignment of the objects will be given a set of
* flags, a user specified alignment and the size of the objects.
*/
-static unsigned int calculate_alignment(slab_flags_t flags,
+unsigned int calculate_alignment(slab_flags_t flags,
unsigned int align, unsigned int size)
{
/*
--
2.34.1
next prev parent reply other threads:[~2023-11-20 9:13 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 ` [PATCH 2/4] mm/slab: remove slab_nomrege and slab_merge sxwjean
2023-11-21 8:44 ` Hyeonggon Yoo
2023-11-22 5:27 ` Song, Xiongwei
2023-11-22 5:59 ` Hyeonggon Yoo
2023-11-20 9:12 ` sxwjean [this message]
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-4-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