[rcu:rcu/urgent 1/1] kernel/rcu/tree.c:253:8: error: implicit declaration of function 'arch_atomic_add_return'; did you mean

From: kernel test robot
Date: Wed Jun 24 2020 - 20:57:49 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/urgent
head: 239341154165cec3676955bab4cc1d61852257ed
commit: 239341154165cec3676955bab4cc1d61852257ed [1/1] rcu: Fixup noinstr warnings
config: m68k-randconfig-r016-20200624 (attached as .config)
compiler: m68k-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
git checkout 239341154165cec3676955bab4cc1d61852257ed
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

kernel/rcu/tree.c: In function 'rcu_dynticks_eqs_enter':
>> kernel/rcu/tree.c:253:8: error: implicit declaration of function 'arch_atomic_add_return'; did you mean 'atomic_add_return'? [-Werror=implicit-function-declaration]
253 | seq = arch_atomic_add_return(RCU_DYNTICK_CTRL_CTR, &rdp->dynticks);
| ^~~~~~~~~~~~~~~~~~~~~~
| atomic_add_return
kernel/rcu/tree.c: In function 'rcu_dynticks_eqs_exit':
>> kernel/rcu/tree.c:283:3: error: implicit declaration of function 'arch_atomic_andnot'; did you mean 'atomic_andnot'? [-Werror=implicit-function-declaration]
283 | arch_atomic_andnot(RCU_DYNTICK_CTRL_MASK, &rdp->dynticks);
| ^~~~~~~~~~~~~~~~~~
| atomic_andnot
kernel/rcu/tree.c: In function 'rcu_dynticks_curr_cpu_in_eqs':
>> kernel/rcu/tree.c:316:11: error: implicit declaration of function 'arch_atomic_read'; did you mean 'atomic_read'? [-Werror=implicit-function-declaration]
316 | return !(arch_atomic_read(&rdp->dynticks) & RCU_DYNTICK_CTRL_CTR);
| ^~~~~~~~~~~~~~~~
| atomic_read
In file included from kernel/rcu/tree.c:4308:
kernel/rcu/tree_stall.h: In function 'check_slow_task':
kernel/rcu/tree_stall.h:240:19: warning: variable 'rnp' set but not used [-Wunused-but-set-variable]
240 | struct rcu_node *rnp;
| ^~~
cc1: some warnings being treated as errors

vim +253 kernel/rcu/tree.c

235
236 /*
237 * Record entry into an extended quiescent state. This is only to be
238 * called when not already in an extended quiescent state, that is,
239 * RCU is watching prior to the call to this function and is no longer
240 * watching upon return.
241 */
242 static noinstr void rcu_dynticks_eqs_enter(void)
243 {
244 struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
245 int seq;
246
247 /*
248 * CPUs seeing atomic_add_return() must see prior RCU read-side
249 * critical sections, and we also must force ordering with the
250 * next idle sojourn.
251 */
252 rcu_dynticks_task_trace_enter(); // Before ->dynticks update!
> 253 seq = arch_atomic_add_return(RCU_DYNTICK_CTRL_CTR, &rdp->dynticks);
254 // RCU is no longer watching. Better be in extended quiescent state!
255 WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
256 (seq & RCU_DYNTICK_CTRL_CTR));
257 /* Better not have special action (TLB flush) pending! */
258 WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
259 (seq & RCU_DYNTICK_CTRL_MASK));
260 }
261
262 /*
263 * Record exit from an extended quiescent state. This is only to be
264 * called from an extended quiescent state, that is, RCU is not watching
265 * prior to the call to this function and is watching upon return.
266 */
267 static noinstr void rcu_dynticks_eqs_exit(void)
268 {
269 struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
270 int seq;
271
272 /*
273 * CPUs seeing atomic_add_return() must see prior idle sojourns,
274 * and we also must force ordering with the next RCU read-side
275 * critical section.
276 */
277 seq = arch_atomic_add_return(RCU_DYNTICK_CTRL_CTR, &rdp->dynticks);
278 // RCU is now watching. Better not be in an extended quiescent state!
279 rcu_dynticks_task_trace_exit(); // After ->dynticks update!
280 WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
281 !(seq & RCU_DYNTICK_CTRL_CTR));
282 if (seq & RCU_DYNTICK_CTRL_MASK) {
> 283 arch_atomic_andnot(RCU_DYNTICK_CTRL_MASK, &rdp->dynticks);
284 smp_mb__after_atomic(); /* _exit after clearing mask. */
285 }
286 }
287
288 /*
289 * Reset the current CPU's ->dynticks counter to indicate that the
290 * newly onlined CPU is no longer in an extended quiescent state.
291 * This will either leave the counter unchanged, or increment it
292 * to the next non-quiescent value.
293 *
294 * The non-atomic test/increment sequence works because the upper bits
295 * of the ->dynticks counter are manipulated only by the corresponding CPU,
296 * or when the corresponding CPU is offline.
297 */
298 static void rcu_dynticks_eqs_online(void)
299 {
300 struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
301
302 if (atomic_read(&rdp->dynticks) & RCU_DYNTICK_CTRL_CTR)
303 return;
304 atomic_add(RCU_DYNTICK_CTRL_CTR, &rdp->dynticks);
305 }
306
307 /*
308 * Is the current CPU in an extended quiescent state?
309 *
310 * No ordering, as we are sampling CPU-local information.
311 */
312 static __always_inline bool rcu_dynticks_curr_cpu_in_eqs(void)
313 {
314 struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
315
> 316 return !(arch_atomic_read(&rdp->dynticks) & RCU_DYNTICK_CTRL_CTR);
317 }
318

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip