tree:
https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/staging.git
lockdep-nesting
head: 7b39687e8b459c32ea6d3c4c454a30917202f1fe
commit: 4d4db5615f8bb1aa782397d90b0c69a72529e0f6 [7/9] lockdep: Add hrtimer context
tracing bits
config: sparc64-randconfig-a001-20200316 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.2.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 4d4db5615f8bb1aa782397d90b0c69a72529e0f6
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=sparc64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel//locking/lockdep.c: In function 'check_wait_context':
kernel//locking/lockdep.c:3878:12: error: 'struct task_struct' has no member
named 'hardirq_context'; did you mean 'audit_context'?
3878 | if (curr->hardirq_context) {
| ^~~~~~~~~~~~~~~
| audit_context
kernel//locking/lockdep.c:3882:11: error: 'struct task_struct' has no member
named 'hardirq_threaded'
3882 | if (curr->hardirq_threaded || curr->irq_config)
| ^~
> kernel//locking/lockdep.c:3882:37: error: 'struct
task_struct' has no member named 'irq_config'
3882 | if
(curr->hardirq_threaded || curr->irq_config)
| ^~
kernel//locking/lockdep.c:3886:17: error: 'struct task_struct' has no member
named 'softirq_context'
3886 | } else if (curr->softirq_context) {
| ^~
vim +3882 kernel//locking/lockdep.c
3835
3836 /*
3837 * Verify the wait_type context.
3838 *
3839 * This check validates we takes locks in the right wait-type order; that is it
3840 * ensures that we do not take mutexes inside spinlocks and do not attempt to
3841 * acquire spinlocks inside raw_spinlocks and the sort.
3842 *
3843 * The entire thing is slightly more complex because of RCU, RCU is a lock that
3844 * can be taken from (pretty much) any context but also has constraints.
3845 * However when taken in a stricter environment the RCU lock does not loosen
3846 * the constraints.
3847 *
3848 * Therefore we must look for the strictest environment in the lock stack and
3849 * compare that to the lock we're trying to acquire.
3850 */
3851 static int check_wait_context(struct task_struct *curr, struct held_lock *next)
3852 {
3853 short next_inner = hlock_class(next)->wait_type_inner;
3854 short next_outer = hlock_class(next)->wait_type_outer;
3855 short curr_inner;
3856 int depth;
3857
3858 if (!curr->lockdep_depth || !next_inner || next->trylock)
3859 return 0;
3860
3861 if (!next_outer)
3862 next_outer = next_inner;
3863
3864 /*
3865 * Find start of current irq_context..
3866 */
3867 for (depth = curr->lockdep_depth - 1; depth >= 0; depth--) {
3868 struct held_lock *prev = curr->held_locks + depth;
3869 if (prev->irq_context != next->irq_context)
3870 break;
3871 }
3872 depth++;
3873
3874 /*
3875 * Set appropriate wait type for the context; for IRQs we have to take
3876 * into account force_irqthread as that is implied by PREEMPT_RT.
3877 */
3878 if (curr->hardirq_context) {
3879 /*
3880 * Check if force_irqthreads will run us threaded.
3881 */
3882 if (curr->hardirq_threaded || curr->irq_config)
3883 curr_inner = LD_WAIT_CONFIG;
3884 else
3885 curr_inner = LD_WAIT_SPIN;
3886 } else if (curr->softirq_context) {
3887 /*
3888 * Softirqs are always threaded.
3889 */
3890 curr_inner = LD_WAIT_CONFIG;
3891 } else {
3892 curr_inner = LD_WAIT_MAX;
3893 }
3894
3895 for (; depth < curr->lockdep_depth; depth++) {
3896 struct held_lock *prev = curr->held_locks + depth;
3897 short prev_inner = hlock_class(prev)->wait_type_inner;
3898
3899 if (prev_inner) {
3900 /*
3901 * We can have a bigger inner than a previous one
3902 * when outer is smaller than inner, as with RCU.
3903 *
3904 * Also due to trylocks.
3905 */
3906 curr_inner = min(curr_inner, prev_inner);
3907 }
3908 }
3909
3910 if (next_outer > curr_inner)
3911 return print_lock_invalid_wait_context(curr, next);
3912
3913 return 0;
3914 }
3915
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org