Skip to content

Commit 1e703d0

Browse files
MiaoheLintehcaster
authored andcommitted
mm/slab: remove some unused functions
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. [ [email protected]: move ____cache_alloc_node() declaration closer to its callers ] Signed-off-by: Miaohe Lin <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Roman Gushchin <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3123109 commit 1e703d0

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

mm/slab.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -619,28 +619,13 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
619619
return 0;
620620
}
621621

622-
static inline void *alternate_node_alloc(struct kmem_cache *cachep,
623-
gfp_t flags)
624-
{
625-
return NULL;
626-
}
627-
628-
static inline void *____cache_alloc_node(struct kmem_cache *cachep,
629-
gfp_t flags, int nodeid)
630-
{
631-
return NULL;
632-
}
633-
634622
static inline gfp_t gfp_exact_node(gfp_t flags)
635623
{
636624
return flags & ~__GFP_NOFAIL;
637625
}
638626

639627
#else /* CONFIG_NUMA */
640628

641-
static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
642-
static void *alternate_node_alloc(struct kmem_cache *, gfp_t);
643-
644629
static struct alien_cache *__alloc_alien_cache(int node, int entries,
645630
int batch, gfp_t gfp)
646631
{
@@ -3056,6 +3041,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
30563041
}
30573042

30583043
#ifdef CONFIG_NUMA
3044+
static void *____cache_alloc_node(struct kmem_cache *, gfp_t, int);
3045+
30593046
/*
30603047
* Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set.
30613048
*

0 commit comments

Comments
 (0)