tree:
https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/staging.git
lockdep-nesting
head: 7b39687e8b459c32ea6d3c4c454a30917202f1fe
commit: b876daa7d5e509b6b59f48fbadb96535adfb2c9d [6/9] lockdep: Introduce wait-type
checks
config: x86_64-randconfig-s1-20200316 (attached as .config)
compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
reproduce:
git checkout b876daa7d5e509b6b59f48fbadb96535adfb2c9d
# save the attached .config to linux build tree
make ARCH=x86_64
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:10: error: 'struct
task_struct' has no member named 'hardirq_context'
if
(curr->hardirq_context) {
^
kernel/locking/lockdep.c:3882:11: error: 'struct task_struct' has no member
named 'hardirq_threaded'
if (curr->hardirq_threaded)
^
kernel/locking/lockdep.c:3886:17: error: 'struct task_struct' has no member
named 'softirq_context'
} else if (curr->softirq_context) {
^
vim +3878 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)
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