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-a003 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) 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 # 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 COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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 errors (new ones prefixed by >>): >> kernel/rcu/rcutorture.c:3499:2: error: '__section__' attribute only applies to functions, global variables, Objective-C methods, and Objective-C properties DEFINE_STATIC_SRCU(srcu1); ^ include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:157:3: note: expanded from macro '__DEFINE_SRCU' __section("___srcu_struct_ptrs") = &name ^ include/linux/compiler_attributes.h:316:56: note: expanded from macro '__section' #define __section(section) __attribute__((__section__(section))) ^ >> kernel/rcu/rcutorture.c:3499:2: error: non-extern declaration of '__srcu_struct_srcu1' follows extern declaration include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:156:29: note: expanded from macro '__DEFINE_SRCU' struct srcu_struct * const __srcu_struct_##name \ ^ :35:1: note: expanded from here __srcu_struct_srcu1 ^ kernel/rcu/rcutorture.c:3499:2: note: previous declaration is here include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:155:36: note: expanded from macro '__DEFINE_SRCU' extern struct srcu_struct * const __srcu_struct_##name; \ ^ :34:1: note: expanded from here __srcu_struct_srcu1 ^ kernel/rcu/rcutorture.c:3500:2: error: '__section__' attribute only applies to functions, global variables, Objective-C methods, and Objective-C properties DEFINE_STATIC_SRCU(srcu2); ^ include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:157:3: note: expanded from macro '__DEFINE_SRCU' __section("___srcu_struct_ptrs") = &name ^ include/linux/compiler_attributes.h:316:56: note: expanded from macro '__section' #define __section(section) __attribute__((__section__(section))) ^ >> kernel/rcu/rcutorture.c:3500:2: error: non-extern declaration of '__srcu_struct_srcu2' follows extern declaration include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:156:29: note: expanded from macro '__DEFINE_SRCU' struct srcu_struct * const __srcu_struct_##name \ ^ :37:1: note: expanded from here __srcu_struct_srcu2 ^ kernel/rcu/rcutorture.c:3500:2: note: previous declaration is here include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:155:36: note: expanded from macro '__DEFINE_SRCU' extern struct srcu_struct * const __srcu_struct_##name; \ ^ :36:1: note: expanded from here __srcu_struct_srcu2 ^ kernel/rcu/rcutorture.c:3501:2: error: '__section__' attribute only applies to functions, global variables, Objective-C methods, and Objective-C properties DEFINE_STATIC_SRCU(srcu3); ^ include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:157:3: note: expanded from macro '__DEFINE_SRCU' __section("___srcu_struct_ptrs") = &name ^ include/linux/compiler_attributes.h:316:56: note: expanded from macro '__section' #define __section(section) __attribute__((__section__(section))) ^ >> kernel/rcu/rcutorture.c:3501:2: error: non-extern declaration of '__srcu_struct_srcu3' follows extern declaration include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:156:29: note: expanded from macro '__DEFINE_SRCU' struct srcu_struct * const __srcu_struct_##name \ ^ :39:1: note: expanded from here __srcu_struct_srcu3 ^ kernel/rcu/rcutorture.c:3501:2: note: previous declaration is here include/linux/srcutree.h:165:34: note: expanded from macro 'DEFINE_STATIC_SRCU' #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) ^ include/linux/srcutree.h:155:36: note: expanded from macro '__DEFINE_SRCU' extern struct srcu_struct * const __srcu_struct_##name; \ ^ :38:1: note: expanded from here __srcu_struct_srcu3 ^ 6 errors generated. vim +/__section__ +3499 kernel/rcu/rcutorture.c 3494 3495 // Test SRCU-based deadlock scenarios. 3496 static void rcu_torture_init_srcu_lockdep(void) 3497 { 3498 int idx; > 3499 DEFINE_STATIC_SRCU(srcu1); > 3500 DEFINE_STATIC_SRCU(srcu2); > 3501 DEFINE_STATIC_SRCU(srcu3); 3502 3503 if (!test_srcu_lockdep) 3504 return; 3505 3506 // Self deadlock. 3507 if (test_srcu_lockdep == 1) { 3508 idx = srcu_read_lock(&srcu1); 3509 synchronize_srcu(&srcu1); 3510 srcu_read_unlock(&srcu1, idx); 3511 return; 3512 } 3513 3514 // Pairwise deadlock. 3515 if (test_srcu_lockdep == 2) { 3516 idx = srcu_read_lock(&srcu1); 3517 synchronize_srcu(&srcu2); 3518 srcu_read_unlock(&srcu1, idx); 3519 3520 idx = srcu_read_lock(&srcu2); 3521 synchronize_srcu(&srcu1); 3522 srcu_read_unlock(&srcu2, idx); 3523 return; 3524 } 3525 3526 // Three-way deadlock. 3527 if (test_srcu_lockdep == 3) { 3528 idx = srcu_read_lock(&srcu1); 3529 synchronize_srcu(&srcu2); 3530 srcu_read_unlock(&srcu1, idx); 3531 3532 idx = srcu_read_lock(&srcu2); 3533 synchronize_srcu(&srcu3); 3534 srcu_read_unlock(&srcu2, idx); 3535 3536 idx = srcu_read_lock(&srcu3); 3537 synchronize_srcu(&srcu1); 3538 srcu_read_unlock(&srcu3, idx); 3539 return; 3540 } 3541 3542 pr_info("%s: test_srcu_lockdep = %d does nothing.\n", __func__, test_srcu_lockdep); 3543 } 3544 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests