Hi "Ahmed, Thank you for the patch! Yet something to improve: [auto build test ERROR on tip/locking/core] [also build test ERROR on nf-next/master nf/master tip/timers/core linus/master v5.7] [cannot apply to next-20200605] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Ahmed-S-Darwish/seqlock-Extend-seqcount-API-with-associated-locks/20200608-090216 base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 19f545b6e07f753c4dc639c2f0ab52345733b6a8 config: sparc-allyesconfig (attached as .config) compiler: sparc64-linux-gcc (GCC) 9.3.0 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 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>, old ones prefixed by <<): In file included from include/linux/seqlock_types_internal.h:18, from include/linux/seqlock.h:680, from include/linux/time.h:6, from arch/sparc/vdso/vdso32/../vclock_gettime.c:16, from arch/sparc/vdso/vdso32/vclock_gettime.c:22: include/linux/ww_mutex.h: In function 'ww_acquire_init': >> include/linux/ww_mutex.h:132:14: error: 'current' undeclared (first use in this function); did you mean 'current_set'? 132 | ctx->task = current; | ^~~~~~~ | current_set include/linux/ww_mutex.h:132:14: note: each undeclared identifier is reported only once for each function it appears in In file included from arch/sparc/vdso/vdso32/vclock_gettime.c:22: arch/sparc/vdso/vdso32/../vclock_gettime.c: At top level: arch/sparc/vdso/vdso32/../vclock_gettime.c:254:1: warning: no previous prototype for '__vdso_clock_gettime' [-Wmissing-prototypes] 254 | __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts) | ^~~~~~~~~~~~~~~~~~~~ arch/sparc/vdso/vdso32/../vclock_gettime.c:282:1: warning: no previous prototype for '__vdso_clock_gettime_stick' [-Wmissing-prototypes] 282 | __vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *ts) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/sparc/vdso/vdso32/../vclock_gettime.c:307:1: warning: no previous prototype for '__vdso_gettimeofday' [-Wmissing-prototypes] 307 | __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) | ^~~~~~~~~~~~~~~~~~~ arch/sparc/vdso/vdso32/../vclock_gettime.c:343:1: warning: no previous prototype for '__vdso_gettimeofday_stick' [-Wmissing-prototypes] 343 | __vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone *tz) | ^~~~~~~~~~~~~~~~~~~~~~~~~ vim +132 include/linux/ww_mutex.h 1b375dc30710180 Maarten Lankhorst 2013-07-05 104 1b375dc30710180 Maarten Lankhorst 2013-07-05 105 /** 1b375dc30710180 Maarten Lankhorst 2013-07-05 106 * ww_acquire_init - initialize a w/w acquire context 1b375dc30710180 Maarten Lankhorst 2013-07-05 107 * @ctx: w/w acquire context to initialize 1b375dc30710180 Maarten Lankhorst 2013-07-05 108 * @ww_class: w/w class of the context 1b375dc30710180 Maarten Lankhorst 2013-07-05 109 * 1b375dc30710180 Maarten Lankhorst 2013-07-05 110 * Initializes an context to acquire multiple mutexes of the given w/w class. 1b375dc30710180 Maarten Lankhorst 2013-07-05 111 * 1b375dc30710180 Maarten Lankhorst 2013-07-05 112 * Context-based w/w mutex acquiring can be done in any order whatsoever within 1b375dc30710180 Maarten Lankhorst 2013-07-05 113 * a given lock class. Deadlocks will be detected and handled with the 55f036ca7e74b85 Peter Ziljstra 2018-06-15 114 * wait/die logic. 1b375dc30710180 Maarten Lankhorst 2013-07-05 115 * 1b375dc30710180 Maarten Lankhorst 2013-07-05 116 * Mixing of context-based w/w mutex acquiring and single w/w mutex locking can 1b375dc30710180 Maarten Lankhorst 2013-07-05 117 * result in undetected deadlocks and is so forbidden. Mixing different contexts 1b375dc30710180 Maarten Lankhorst 2013-07-05 118 * for the same w/w class when acquiring mutexes can also result in undetected 1b375dc30710180 Maarten Lankhorst 2013-07-05 119 * deadlocks, and is hence also forbidden. Both types of abuse will be caught by 1b375dc30710180 Maarten Lankhorst 2013-07-05 120 * enabling CONFIG_PROVE_LOCKING. 1b375dc30710180 Maarten Lankhorst 2013-07-05 121 * 1b375dc30710180 Maarten Lankhorst 2013-07-05 122 * Nesting of acquire contexts for _different_ w/w classes is possible, subject 1b375dc30710180 Maarten Lankhorst 2013-07-05 123 * to the usual locking rules between different lock classes. 1b375dc30710180 Maarten Lankhorst 2013-07-05 124 * 1b375dc30710180 Maarten Lankhorst 2013-07-05 125 * An acquire context must be released with ww_acquire_fini by the same task 1b375dc30710180 Maarten Lankhorst 2013-07-05 126 * before the memory is freed. It is recommended to allocate the context itself 1b375dc30710180 Maarten Lankhorst 2013-07-05 127 * on the stack. 1b375dc30710180 Maarten Lankhorst 2013-07-05 128 */ 1b375dc30710180 Maarten Lankhorst 2013-07-05 129 static inline void ww_acquire_init(struct ww_acquire_ctx *ctx, 1b375dc30710180 Maarten Lankhorst 2013-07-05 130 struct ww_class *ww_class) 1b375dc30710180 Maarten Lankhorst 2013-07-05 131 { 1b375dc30710180 Maarten Lankhorst 2013-07-05 @132 ctx->task = current; f4ec57b632fe15e Peter Zijlstra 2016-11-24 133 ctx->stamp = atomic_long_inc_return_relaxed(&ww_class->stamp); 1b375dc30710180 Maarten Lankhorst 2013-07-05 134 ctx->acquired = 0; 08295b3b5beec9a Thomas Hellstrom 2018-06-15 135 ctx->wounded = false; 08295b3b5beec9a Thomas Hellstrom 2018-06-15 136 ctx->is_wait_die = ww_class->is_wait_die; 1b375dc30710180 Maarten Lankhorst 2013-07-05 137 #ifdef CONFIG_DEBUG_MUTEXES 1b375dc30710180 Maarten Lankhorst 2013-07-05 138 ctx->ww_class = ww_class; 1b375dc30710180 Maarten Lankhorst 2013-07-05 139 ctx->done_acquire = 0; 1b375dc30710180 Maarten Lankhorst 2013-07-05 140 ctx->contending_lock = NULL; 1b375dc30710180 Maarten Lankhorst 2013-07-05 141 #endif 1b375dc30710180 Maarten Lankhorst 2013-07-05 142 #ifdef CONFIG_DEBUG_LOCK_ALLOC 1b375dc30710180 Maarten Lankhorst 2013-07-05 143 debug_check_no_locks_freed((void *)ctx, sizeof(*ctx)); 1b375dc30710180 Maarten Lankhorst 2013-07-05 144 lockdep_init_map(&ctx->dep_map, ww_class->acquire_name, 1b375dc30710180 Maarten Lankhorst 2013-07-05 145 &ww_class->acquire_key, 0); 1b375dc30710180 Maarten Lankhorst 2013-07-05 146 mutex_acquire(&ctx->dep_map, 0, 0, _RET_IP_); 1b375dc30710180 Maarten Lankhorst 2013-07-05 147 #endif 1b375dc30710180 Maarten Lankhorst 2013-07-05 148 #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH 1b375dc30710180 Maarten Lankhorst 2013-07-05 149 ctx->deadlock_inject_interval = 1; 1b375dc30710180 Maarten Lankhorst 2013-07-05 150 ctx->deadlock_inject_countdown = ctx->stamp & 0xf; 1b375dc30710180 Maarten Lankhorst 2013-07-05 151 #endif 1b375dc30710180 Maarten Lankhorst 2013-07-05 152 } 1b375dc30710180 Maarten Lankhorst 2013-07-05 153 :::::: The code at line 132 was first introduced by commit :::::: 1b375dc30710180c4b88cc59caba6e3481ec5c8b mutex: Move ww_mutex definitions to ww_mutex.h :::::: TO: Maarten Lankhorst :::::: CC: Ingo Molnar --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org