mm, slab: move prepare_slab_obj_exts_hook under CONFIG_MEM_ALLOC_PROFILING
Subsystems (2)
PATCH 1/1 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.
---
Applied over slab/for-next because of the refactoring [1] in that branch.
[1] 302a3ea38aec ("mm, slab: move allocation tagging code in the alloc path into a hook")
mm/slub.c | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-)
mm/slub.c +21 -27
@@ -2027,6 +2027,27 @@ static inline bool need_slab_obj_ext(void)return false; } +#else /* CONFIG_SLAB_OBJ_EXT */ + +static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, +gfp_t gfp,bool new_slab) +{ +return 0 ; +} + +static inline void free_slab_obj_exts (struct slab *slab) +{ +} + +static inline bool need_slab_obj_ext (void ) +{ +return false; +} + +#endif /* CONFIG_SLAB_OBJ_EXT */ + +#ifdef CONFIG_MEM_ALLOC_PROFILING +static inline struct slabobj_ext *prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) {
@@ -2051,33 +2072,6 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)return slab_obj_exts (slab) +obj_to_index (s, slab, p); } -#else /* CONFIG_SLAB_OBJ_EXT */ - -static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, -gfp_t gfp,bool new_slab) -{ -return 0 ; -} - -static inline void free_slab_obj_exts (struct slab *slab) -{ -} - -static inline bool need_slab_obj_ext (void ) -{ -return false; -} - -static inline struct slabobj_ext * -prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) -{ -return NULL ; -} - -#endif /* CONFIG_SLAB_OBJ_EXT */ - -#ifdef CONFIG_MEM_ALLOC_PROFILING -static inline void alloc_tagging_slab_alloc_hook (struct kmem_cache *s,void *object,gfp_t flags) {
base-commit: fe4e761669ab4d8b388fdb6e9dbe9a110eed8009
Signature · 1 line
2.45.2.993.g49e7a77208-goog
Quoted 7 lines · Suren Baghdasaryan
The only place
prepare_slab_obj_exts_hook()is currently being used is fromalloc_tagging_slab_alloc_hook()whenCONFIG_MEM_ALLOC_PROFILING=y. Move its definition underCONFIG_MEM_ALLOC_PROFILINGto prevent unused function warning forCONFIG_SLAB_OBJ_EXT=ncase.
Hm so that's a mainline report, but being a clang-only W=1 warning I think it can just wait for the merge window and no need for last-minute 6.10 fix.
Quoted 4 lines
Signed-off-by Suren Baghdasaryan <[email protected]>Cc Vlastimil Babka <[email protected]>---
Applied over slab/for-next because of the refactoring [1] in that branch.
And thus took it there. thanks.
Quoted 74 lines
[1]
302a3ea38aec("mm, slab: move allocation tagging code in the alloc path into a hook")mm/slub.c | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-)mm/slub.c +21
-27@@ -2027,6 +2027,27 @@ static inline bool need_slab_obj_ext(void)return false; } +#else /* CONFIG_SLAB_OBJ_EXT */ + +static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, +gfp_t gfp,bool new_slab) +{ +return 0 ; +} + +static inline void free_slab_obj_exts (struct slab *slab) +{ +} + +static inline bool need_slab_obj_ext (void ) +{ +return false; +} + +#endif /* CONFIG_SLAB_OBJ_EXT */ + +#ifdef CONFIG_MEM_ALLOC_PROFILING +static inline struct slabobj_ext *prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) {@@ -2051,33 +2072,6 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)return slab_obj_exts (slab) +obj_to_index (s, slab, p); } -#else /* CONFIG_SLAB_OBJ_EXT */ - -static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, -gfp_t gfp,bool new_slab) -{ -return 0 ; -} - -static inline void free_slab_obj_exts (struct slab *slab) -{ -} - -static inline bool need_slab_obj_ext (void ) -{ -return false; -} - -static inline struct slabobj_ext * -prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) -{ -return NULL ; -} - -#endif /* CONFIG_SLAB_OBJ_EXT */ - -#ifdef CONFIG_MEM_ALLOC_PROFILING -static inline void alloc_tagging_slab_alloc_hook (struct kmem_cache *s,void *object,gfp_t flags) {base-commit:
fe4e761669ab4d8b388fdb6e9dbe9a110eed8009
Quoted 7 lines · Vlastimil Babka
Quoted 5 lines · Suren Baghdasaryan
The only place
prepare_slab_obj_exts_hook()is currently being used is fromalloc_tagging_slab_alloc_hook()whenCONFIG_MEM_ALLOC_PROFILING=y. Move its definition underCONFIG_MEM_ALLOC_PROFILINGto prevent unused function warning forCONFIG_SLAB_OBJ_EXT=ncase.
Quoted 5 lines
Quoted 2 lines
Hm so that's a mainline report, but being a clang-only W=1 warning I think it can just wait for the merge window and no need for last-minute 6.10 fix.
Correct. I was wrong thinking that [1] caused this. The warning was there even before but adding this into slab/for-next simply avoids merge conflicts.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Suren Baghdasaryan <[email protected]>Cc Vlastimil Babka <[email protected]>---
Applied over slab/for-next because of the refactoring [1] in that branch.And thus took it there. thanks.
Thanks!
Quoted 76 lines
Quoted 75 lines
[1]
302a3ea38aec("mm, slab: move allocation tagging code in the alloc path into a hook")mm/slub.c | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-)mm/slub.c +21
-27@@ -2027,6 +2027,27 @@ static inline bool need_slab_obj_ext(void)return false; } +#else /* CONFIG_SLAB_OBJ_EXT */ + +static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, +gfp_t gfp,bool new_slab) +{ +return 0 ; +} + +static inline void free_slab_obj_exts (struct slab *slab) +{ +} + +static inline bool need_slab_obj_ext (void ) +{ +return false; +} + +#endif /* CONFIG_SLAB_OBJ_EXT */ + +#ifdef CONFIG_MEM_ALLOC_PROFILING +static inline struct slabobj_ext *prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) {@@ -2051,33 +2072,6 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)return slab_obj_exts (slab) +obj_to_index (s, slab, p); } -#else /* CONFIG_SLAB_OBJ_EXT */ - -static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, -gfp_t gfp,bool new_slab) -{ -return 0 ; -} - -static inline void free_slab_obj_exts (struct slab *slab) -{ -} - -static inline bool need_slab_obj_ext (void ) -{ -return false; -} - -static inline struct slabobj_ext * -prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) -{ -return NULL ; -} - -#endif /* CONFIG_SLAB_OBJ_EXT */ - -#ifdef CONFIG_MEM_ALLOC_PROFILING -static inline void alloc_tagging_slab_alloc_hook (struct kmem_cache *s,void *object,gfp_t flags) {base-commit:
fe4e761669ab4d8b388fdb6e9dbe9a110eed8009
Quoted 9 lines · Suren Baghdasaryan
The only place
prepare_slab_obj_exts_hook()is currently being used isfrom
alloc_tagging_slab_alloc_hook()whenCONFIG_MEM_ALLOC_PROFILING=y.Move its definition under
CONFIG_MEM_ALLOC_PROFILINGto prevent unusedfunction warning for
CONFIG_SLAB_OBJ_EXT=ncase.
Quoted 7 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Suren Baghdasaryan <[email protected]>Cc Vlastimil Babka <[email protected]>
Thanks.
Quoted 149 lines
---
Applied over slab/for-next because of the refactoring [1] in that branch.
[1]
302a3ea38aec("mm, slab: move allocation tagging code in the alloc path into a hook")mm/slub.c | 48 +++++++++++++++++++++---------------------------1 file changed, 21 insertions(+), 27 deletions(-)mm/slub.c +0
-0index
ce39544acf7c..829a1f08e8a2100644---
a/mm/slub.c+++
b/mm/slub.cmm/slub.c +21
-27@@ -2027,6 +2027,27 @@ static inline bool need_slab_obj_ext(void)return false; } +#else /* CONFIG_SLAB_OBJ_EXT */ + +static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, +gfp_t gfp,bool new_slab) +{ +return 0 ; +} + +static inline void free_slab_obj_exts (struct slab *slab) +{ +} + +static inline bool need_slab_obj_ext (void ) +{ +return false; +} + +#endif /* CONFIG_SLAB_OBJ_EXT */ + +#ifdef CONFIG_MEM_ALLOC_PROFILING +static inline struct slabobj_ext *prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) {@@ -2051,33 +2072,6 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)return slab_obj_exts (slab) +obj_to_index (s, slab, p); } -#else /* CONFIG_SLAB_OBJ_EXT */ - -static int alloc_slab_obj_exts (struct slab *slab,struct kmem_cache *s, -gfp_t gfp,bool new_slab) -{ -return 0 ; -} - -static inline void free_slab_obj_exts (struct slab *slab) -{ -} - -static inline bool need_slab_obj_ext (void ) -{ -return false; -} - -static inline struct slabobj_ext * -prepare_slab_obj_exts_hook (struct kmem_cache *s,gfp_t flags,void *p) -{ -return NULL ; -} - -#endif /* CONFIG_SLAB_OBJ_EXT */ - -#ifdef CONFIG_MEM_ALLOC_PROFILING -static inline void alloc_tagging_slab_alloc_hook (struct kmem_cache *s,void *object,gfp_t flags) {base-commit:
fe4e761669ab4d8b388fdb6e9dbe9a110eed8009Signature · 1 line
2.45.2.993.g49e7a77208-goog