[mingo-tip:master 1440/2335] include/linux/rcupdate.h:381:9: error: dereferencing pointer to incomplete type 'struct task_struct'

From: kernel test robot
Date: Thu Mar 17 2022 - 00:57:31 EST


tree: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git master
head: 85293bf3fca6d85608cff1447ce3097583f15fab
commit: 60aa8b48a7618b32090b091987090a4795b278cb [1440/2335] headers/deps: rcu/wait: Remove <linux/sched/task_flags.h> from <linux/rcuwait.h>
config: i386-randconfig-a001-20220314 (https://download.01.org/0day-ci/archive/20220317/202203171240.Swhj47Ft-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=60aa8b48a7618b32090b091987090a4795b278cb
git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
git fetch --no-tags mingo-tip master
git checkout 60aa8b48a7618b32090b091987090a4795b278cb
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

In file included from include/linux/rcuwait.h:5,
from include/linux/percpu_rwsem.h:7,
from include/linux/percpu_rwsem_api.h:2,
from fs/ext4/migrate.c:10:
include/linux/rcuwait.h: In function 'rcuwait_active':
>> include/linux/rcupdate.h:381:9: error: dereferencing pointer to incomplete type 'struct task_struct'
381 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
| ^
include/linux/rcupdate.h:492:31: note: in expansion of macro '__rcu_access_pointer'
492 | #define rcu_access_pointer(p) __rcu_access_pointer((p), __UNIQUE_ID(rcu), __rcu)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/rcuwait.h:33:11: note: in expansion of macro 'rcu_access_pointer'
33 | return !!rcu_access_pointer(w->task);
| ^~~~~~~~~~~~~~~~~~


vim +381 include/linux/rcupdate.h

76c8eaafe4f061 Paul E. McKenney 2021-04-21 378
24ba53017e188e Chun-Hung Tseng 2021-09-15 379 #define __rcu_access_pointer(p, local, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 380 ({ \
24ba53017e188e Chun-Hung Tseng 2021-09-15 @381 typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 382) rcu_check_sparse(p, space); \
24ba53017e188e Chun-Hung Tseng 2021-09-15 383 ((typeof(*p) __force __kernel *)(local)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 384 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 385 #define __rcu_dereference_check(p, local, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 386 ({ \
ac59853c06993a Pranith Kumar 2014-11-13 387 /* Dependency order vs. p above. */ \
24ba53017e188e Chun-Hung Tseng 2021-09-15 388 typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 389 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 390) rcu_check_sparse(p, space); \
24ba53017e188e Chun-Hung Tseng 2021-09-15 391 ((typeof(*p) __force __kernel *)(local)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 392 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 393 #define __rcu_dereference_protected(p, local, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 394 ({ \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 395 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 396) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 397 ((typeof(*p) __force __kernel *)(p)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 398 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 399 #define __rcu_dereference_raw(p, local) \
995f1405610bd8 Paul E. McKenney 2016-07-01 400 ({ \
995f1405610bd8 Paul E. McKenney 2016-07-01 401 /* Dependency order vs. p above. */ \
24ba53017e188e Chun-Hung Tseng 2021-09-15 402 typeof(p) local = READ_ONCE(p); \
24ba53017e188e Chun-Hung Tseng 2021-09-15 403 ((typeof(*p) __force __kernel *)(local)); \
995f1405610bd8 Paul E. McKenney 2016-07-01 404 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 405 #define rcu_dereference_raw(p) __rcu_dereference_raw(p, __UNIQUE_ID(rcu))
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 406

:::::: The code at line 381 was first introduced by commit
:::::: 24ba53017e188e031f9cb8b290286fad52d2af00 rcu: Replace ________p1 and _________p1 with __UNIQUE_ID(rcu)

:::::: TO: Chun-Hung Tseng <henrybear327@xxxxxxxxx>
:::::: CC: Paul E. McKenney <paulmck@xxxxxxxxxx>

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