Skip to content

Commit 7b1fdf2

Browse files
surenbaghdasaryantehcaster
authored andcommitted
mm, slab: move prepare_slab_obj_exts_hook under CONFIG_MEM_ALLOC_PROFILING
The only place prepare_slab_obj_exts_hook() is currently being used is from alloc_tagging_slab_alloc_hook() when CONFIG_MEM_ALLOC_PROFILING=y. Move its definition under CONFIG_MEM_ALLOC_PROFILING to prevent unused function warning for CONFIG_SLAB_OBJ_EXT=n case. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Suren Baghdasaryan <[email protected]> Cc: Vlastimil Babka <[email protected]> Reviewed-by: Xiongwei Song <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 302a3ea commit 7b1fdf2

File tree

1 file changed

+21
-27
lines changed

1 file changed

+21
-27
lines changed

mm/slub.c

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,6 +2009,27 @@ static inline bool need_slab_obj_ext(void)
20092009
return false;
20102010
}
20112011

2012+
#else /* CONFIG_SLAB_OBJ_EXT */
2013+
2014+
static int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
2015+
gfp_t gfp, bool new_slab)
2016+
{
2017+
return 0;
2018+
}
2019+
2020+
static inline void free_slab_obj_exts(struct slab *slab)
2021+
{
2022+
}
2023+
2024+
static inline bool need_slab_obj_ext(void)
2025+
{
2026+
return false;
2027+
}
2028+
2029+
#endif /* CONFIG_SLAB_OBJ_EXT */
2030+
2031+
#ifdef CONFIG_MEM_ALLOC_PROFILING
2032+
20122033
static inline struct slabobj_ext *
20132034
prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
20142035
{
@@ -2033,33 +2054,6 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
20332054
return slab_obj_exts(slab) + obj_to_index(s, slab, p);
20342055
}
20352056

2036-
#else /* CONFIG_SLAB_OBJ_EXT */
2037-
2038-
static int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
2039-
gfp_t gfp, bool new_slab)
2040-
{
2041-
return 0;
2042-
}
2043-
2044-
static inline void free_slab_obj_exts(struct slab *slab)
2045-
{
2046-
}
2047-
2048-
static inline bool need_slab_obj_ext(void)
2049-
{
2050-
return false;
2051-
}
2052-
2053-
static inline struct slabobj_ext *
2054-
prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
2055-
{
2056-
return NULL;
2057-
}
2058-
2059-
#endif /* CONFIG_SLAB_OBJ_EXT */
2060-
2061-
#ifdef CONFIG_MEM_ALLOC_PROFILING
2062-
20632057
static inline void
20642058
alloc_tagging_slab_alloc_hook(struct kmem_cache *s, void *object, gfp_t flags)
20652059
{

0 commit comments

Comments
 (0)