2021-09-02 18:25:06

by kernel test robot

[permalink] [raw]
Subject: kernel/sched/core.c:5854:20: warning: unused function 'sched_core_cpu_deactivate'

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4a3bb4200a5958d76cc26ebe4db4257efa56812b
commit: 3c474b3239f12fe0b00d7e82481f36a1f31e79ab sched: Fix Core-wide rq->lock for uninitialized CPUs
date: 13 days ago
config: mips-randconfig-r004-20210902 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c9948e9254fbb6ea00f66c7b4542311d21e060be)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3c474b3239f12fe0b00d7e82481f36a1f31e79ab
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3c474b3239f12fe0b00d7e82481f36a1f31e79ab
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=mips SHELL=/bin/bash kernel/sched/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

kernel/sched/core.c:3272:20: warning: unused function 'rq_has_pinned_tasks'
static inline bool rq_has_pinned_tasks(struct rq
^
kernel/sched/core.c:5123:20: warning: unused function 'sched_tick_start'
static inline void sched_tick_start(int cpu) { }
^
kernel/sched/core.c:5124:20: warning: unused function 'sched_tick_stop'
static inline void sched_tick_stop(int cpu) { }
^
kernel/sched/core.c:5853:20: warning: unused function 'sched_core_cpu_starting'
static inline void sched_core_cpu_starting(unsigned int cpu) {}
^
>> kernel/sched/core.c:5854:20: warning: unused function 'sched_core_cpu_deactivate'
static inline void sched_core_cpu_deactivate(unsigned int cpu) {}
^
>> kernel/sched/core.c:5855:20: warning: unused function 'sched_core_cpu_dying'
static inline void sched_core_cpu_dying(unsigned int cpu) {}
^
fatal error: error in backend: Nested variants found in inline asm string: ' .set push
.set noat
.set push
.set arch=r4000
.if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/cmpxchg.h", .line = 163, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
1: ll $0, $2 # __cmpxchg_asm
bne $0, ${3:z}, 2f
.set pop
move $$1, ${4:z}
.set arch=r4000
sc $$1, $1
beqz $$1, 1b
.set pop
2: .if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/cmpxchg.h", .line = 163, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
'
clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 14.0.0 (git://gitmirror/llvm_project c9948e9254fbb6ea00f66c7b4542311d21e060be)
Target: mipsel-unknown-linux
Thread model: posix
InstalledDir: /opt/cross/clang-c9948e9254/bin
clang-14: note: diagnostic msg:
Makefile arch include kernel mm nr_bisected scripts source usr


vim +/sched_core_cpu_deactivate +5854 kernel/sched/core.c

5852
5853 static inline void sched_core_cpu_starting(unsigned int cpu) {}
> 5854 static inline void sched_core_cpu_deactivate(unsigned int cpu) {}
> 5855 static inline void sched_core_cpu_dying(unsigned int cpu) {}
5856

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (4.05 kB)
.config.gz (25.23 kB)
Download all attachments

2021-09-02 18:30:24

by Nathan Chancellor

[permalink] [raw]
Subject: Re: kernel/sched/core.c:5854:20: warning: unused function 'sched_core_cpu_deactivate'

On 9/2/2021 11:21 AM, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 4a3bb4200a5958d76cc26ebe4db4257efa56812b
> commit: 3c474b3239f12fe0b00d7e82481f36a1f31e79ab sched: Fix Core-wide rq->lock for uninitialized CPUs
> date: 13 days ago
> config: mips-randconfig-r004-20210902 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c9948e9254fbb6ea00f66c7b4542311d21e060be)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install mips cross compiling tool for clang build
> # apt-get install binutils-mips-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3c474b3239f12fe0b00d7e82481f36a1f31e79ab
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 3c474b3239f12fe0b00d7e82481f36a1f31e79ab
> # save the attached .config to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=mips SHELL=/bin/bash kernel/sched/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
> All warnings (new ones prefixed by >>):
>
> kernel/sched/core.c:3272:20: warning: unused function 'rq_has_pinned_tasks'
> static inline bool rq_has_pinned_tasks(struct rq
> ^
> kernel/sched/core.c:5123:20: warning: unused function 'sched_tick_start'
> static inline void sched_tick_start(int cpu) { }
> ^
> kernel/sched/core.c:5124:20: warning: unused function 'sched_tick_stop'
> static inline void sched_tick_stop(int cpu) { }
> ^
> kernel/sched/core.c:5853:20: warning: unused function 'sched_core_cpu_starting'
> static inline void sched_core_cpu_starting(unsigned int cpu) {}
> ^
>>> kernel/sched/core.c:5854:20: warning: unused function 'sched_core_cpu_deactivate'
> static inline void sched_core_cpu_deactivate(unsigned int cpu) {}
> ^
>>> kernel/sched/core.c:5855:20: warning: unused function 'sched_core_cpu_dying'
> static inline void sched_core_cpu_dying(unsigned int cpu) {}
> ^
> fatal error: error in backend: Nested variants found in inline asm string: ' .set push
> .set noat
> .set push
> .set arch=r4000
> .if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/cmpxchg.h", .line = 163, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
> 1: ll $0, $2 # __cmpxchg_asm
> bne $0, ${3:z}, 2f
> .set pop
> move $$1, ${4:z}
> .set arch=r4000
> sc $$1, $1
> beqz $$1, 1b
> .set pop
> 2: .if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/cmpxchg.h", .line = 163, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
> '
> clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation)
> clang version 14.0.0 (git://gitmirror/llvm_project c9948e9254fbb6ea00f66c7b4542311d21e060be)
> Target: mipsel-unknown-linux
> Thread model: posix
> InstalledDir: /opt/cross/clang-c9948e9254/bin
> clang-14: note: diagnostic msg:
> Makefile arch include kernel mm nr_bisected scripts source usr
>
>
> vim +/sched_core_cpu_deactivate +5854 kernel/sched/core.c
>
> 5852
> 5853 static inline void sched_core_cpu_starting(unsigned int cpu) {}
>> 5854 static inline void sched_core_cpu_deactivate(unsigned int cpu) {}
>> 5855 static inline void sched_core_cpu_dying(unsigned int cpu) {}
> 5856

Is there any way for the test robot to ignore -Wunused-function warnings
for stub functions? Masahiro purposefully wanted these warnings shown
for static inline functions after commit 6863f5643dd7 ("kbuild: allow
Clang to find unused static inline functions for W=1 build") but the
entire point of the stub functions is that there should be no warnings
ever (even though I know this is a W=1 build but still...).

Cheers,
Nathan