lkml.org 
[lkml]   [2022]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH] mm/slab: remove some unused functions
From
On 3/22/22 10:14, Miaohe Lin wrote:
> alternate_node_alloc and ____cache_alloc_node are always called when
> CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also
> forward declaration for alternate_node_alloc is unnecessary. Remove
> it too.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---

Adding to the slab tree, thanks.

Included also this move of declaration closer to its users:

diff --git a/mm/slab.c b/mm/slab.c
index 4ea12ddaa7db..90b16c7ae01a 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -626,8 +626,6 @@ static inline gfp_t gfp_exact_node(gfp_t flags)

#else /* CONFIG_NUMA */

-static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
-
static struct alien_cache *__alloc_alien_cache(int node, int entries,
int batch, gfp_t gfp)
{
@@ -3043,6 +3041,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
}

#ifdef CONFIG_NUMA
+static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
+
/*
* Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set.
*
\
 
 \ /
  Last update: 2022-09-17 16:19    [W:2.592 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site