tree: https://github.com/ammarfaizi2/linux-block paulmck/linux-rcu/dev head: 2efd22b2fae506a1c5d3f165bdbb5432cbb12745 commit: 2efd22b2fae506a1c5d3f165bdbb5432cbb12745 [49/49] rcutorture: Add SRCU deadlock scenarios config: x86_64-randconfig-a004 compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/ammarfaizi2/linux-block/commit/2efd22b2fae506a1c5d3f165bdbb5432cbb12745 git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block paulmck/linux-rcu/dev git checkout 2efd22b2fae506a1c5d3f165bdbb5432cbb12745 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 olddefconfig make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/rcu/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from include/linux/srcu.h:49, from include/linux/notifier.h:16, from include/linux/memory_hotplug.h:7, from include/linux/mmzone.h:1269, from include/linux/gfp.h:7, from include/linux/umh.h:4, from include/linux/kmod.h:9, from include/linux/module.h:17, from kernel/rcu/rcutorture.c:18: kernel/rcu/rcutorture.c: In function 'rcu_torture_init_srcu_lockdep': include/linux/srcutree.h:156:36: error: section attribute cannot be specified for local variables 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3499:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3499 | DEFINE_STATIC_SRCU(srcu1); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:156:36: error: declaration of '__srcu_struct_srcu1' with no linkage follows extern declaration 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3499:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3499 | DEFINE_STATIC_SRCU(srcu1); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:155:43: note: previous declaration of '__srcu_struct_srcu1' with type 'struct srcu_struct * const' 155 | extern struct srcu_struct * const __srcu_struct_##name; \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3499:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3499 | DEFINE_STATIC_SRCU(srcu1); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:156:36: error: section attribute cannot be specified for local variables 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3500:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3500 | DEFINE_STATIC_SRCU(srcu2); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:156:36: error: declaration of '__srcu_struct_srcu2' with no linkage follows extern declaration 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3500:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3500 | DEFINE_STATIC_SRCU(srcu2); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:155:43: note: previous declaration of '__srcu_struct_srcu2' with type 'struct srcu_struct * const' 155 | extern struct srcu_struct * const __srcu_struct_##name; \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3500:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3500 | DEFINE_STATIC_SRCU(srcu2); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:156:36: error: section attribute cannot be specified for local variables 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3501:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3501 | DEFINE_STATIC_SRCU(srcu3); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:156:36: error: declaration of '__srcu_struct_srcu3' with no linkage follows extern declaration 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3501:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3501 | DEFINE_STATIC_SRCU(srcu3); | ^~~~~~~~~~~~~~~~~~ include/linux/srcutree.h:155:43: note: previous declaration of '__srcu_struct_srcu3' with type 'struct srcu_struct * const' 155 | extern struct srcu_struct * const __srcu_struct_##name; \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3501:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3501 | DEFINE_STATIC_SRCU(srcu3); | ^~~~~~~~~~~~~~~~~~ >> include/linux/srcutree.h:156:36: warning: unused variable '__srcu_struct_srcu3' [-Wunused-variable] 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3501:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3501 | DEFINE_STATIC_SRCU(srcu3); | ^~~~~~~~~~~~~~~~~~ >> include/linux/srcutree.h:156:36: warning: unused variable '__srcu_struct_srcu2' [-Wunused-variable] 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3500:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3500 | DEFINE_STATIC_SRCU(srcu2); | ^~~~~~~~~~~~~~~~~~ >> include/linux/srcutree.h:156:36: warning: unused variable '__srcu_struct_srcu1' [-Wunused-variable] 156 | struct srcu_struct * const __srcu_struct_##name \ | ^~~~~~~~~~~~~~ include/linux/srcutree.h:165:41: note: in expansion of macro '__DEFINE_SRCU' 165 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) | ^~~~~~~~~~~~~ kernel/rcu/rcutorture.c:3499:9: note: in expansion of macro 'DEFINE_STATIC_SRCU' 3499 | DEFINE_STATIC_SRCU(srcu1); | ^~~~~~~~~~~~~~~~~~ vim +/__srcu_struct_srcu3 +156 include/linux/srcutree.h d8be81735aa894 Paul E. McKenney 2017-03-25 132 d8be81735aa894 Paul E. McKenney 2017-03-25 133 /* d8be81735aa894 Paul E. McKenney 2017-03-25 134 * Define and initialize a srcu struct at build time. d8be81735aa894 Paul E. McKenney 2017-03-25 135 * Do -not- call init_srcu_struct() nor cleanup_srcu_struct() on it. d8be81735aa894 Paul E. McKenney 2017-03-25 136 * d8be81735aa894 Paul E. McKenney 2017-03-25 137 * Note that although DEFINE_STATIC_SRCU() hides the name from other d8be81735aa894 Paul E. McKenney 2017-03-25 138 * files, the per-CPU variable rules nevertheless require that the d8be81735aa894 Paul E. McKenney 2017-03-25 139 * chosen name be globally unique. These rules also prohibit use of d8be81735aa894 Paul E. McKenney 2017-03-25 140 * DEFINE_STATIC_SRCU() within a function. If these rules are too d8be81735aa894 Paul E. McKenney 2017-03-25 141 * restrictive, declare the srcu_struct manually. For example, in d8be81735aa894 Paul E. McKenney 2017-03-25 142 * each file: d8be81735aa894 Paul E. McKenney 2017-03-25 143 * d8be81735aa894 Paul E. McKenney 2017-03-25 144 * static struct srcu_struct my_srcu; d8be81735aa894 Paul E. McKenney 2017-03-25 145 * d8be81735aa894 Paul E. McKenney 2017-03-25 146 * Then, before the first use of each my_srcu, manually initialize it: d8be81735aa894 Paul E. McKenney 2017-03-25 147 * d8be81735aa894 Paul E. McKenney 2017-03-25 148 * init_srcu_struct(&my_srcu); d8be81735aa894 Paul E. McKenney 2017-03-25 149 * d8be81735aa894 Paul E. McKenney 2017-03-25 150 * See include/linux/percpu-defs.h for the rules on per-CPU variables. d8be81735aa894 Paul E. McKenney 2017-03-25 151 */ fe15b50cdeeebd Paul E. McKenney 2019-04-05 152 #ifdef MODULE fe15b50cdeeebd Paul E. McKenney 2019-04-05 153 # define __DEFINE_SRCU(name, is_static) \ fe15b50cdeeebd Paul E. McKenney 2019-04-05 154 is_static struct srcu_struct name; \ db8f1471c61336 Alexander Aring 2022-01-26 155 extern struct srcu_struct * const __srcu_struct_##name; \ 056b89e7e69974 Joel Fernandes (Google 2019-04-11 @156) struct srcu_struct * const __srcu_struct_##name \ fe15b50cdeeebd Paul E. McKenney 2019-04-05 157 __section("___srcu_struct_ptrs") = &name fe15b50cdeeebd Paul E. McKenney 2019-04-05 158 #else d8be81735aa894 Paul E. McKenney 2017-03-25 159 # define __DEFINE_SRCU(name, is_static) \ da915ad5cf25b5 Paul E. McKenney 2017-04-05 160 static DEFINE_PER_CPU(struct srcu_data, name##_srcu_data); \ fe15b50cdeeebd Paul E. McKenney 2019-04-05 161 is_static struct srcu_struct name = \ fe15b50cdeeebd Paul E. McKenney 2019-04-05 162 __SRCU_STRUCT_INIT(name, name##_srcu_data) fe15b50cdeeebd Paul E. McKenney 2019-04-05 163 #endif d8be81735aa894 Paul E. McKenney 2017-03-25 164 #define DEFINE_SRCU(name) __DEFINE_SRCU(name, /* not static */) d8be81735aa894 Paul E. McKenney 2017-03-25 165 #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) d8be81735aa894 Paul E. McKenney 2017-03-25 166 :::::: The code at line 156 was first introduced by commit :::::: 056b89e7e699742cc060ce722d3f26effe51b4aa module: Make srcu_struct ptr array as read-only :::::: TO: Joel Fernandes (Google) :::::: CC: Paul E. McKenney -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests