Hello, kernel test robot noticed "WARNING:inconsistent_lock_state" on: commit: 1dbf9cad3182c9decb9aba874dfd3f3f7f5dcf61 ("shmem: stable directory cookies") https://git.kernel.org/cgit/linux/kernel/git/jlayton/linux.git tmpfs in testcase: kernel-selftests version: kernel-selftests-x86_64-60acb023-1_20230329 with following parameters: group: sgx test-description: The kernel contains a set of "self tests" under the tools/testing/selftests/ directory. These are intended to be small unit tests to exercise individual code paths in the kernel. test-url: https://www.kernel.org/doc/Documentation/kselftest.txt compiler: gcc-11 test machine: 16 threads 1 sockets Intel(R) Xeon(R) E-2278G CPU @ 3.40GHz (Coffee Lake) with 32G memory (please refer to attached dmesg/kmsg for entire log/backtrace) If you fix the issue, kindly add following tag | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-lkp/202304101018.4e0ba3fd-oliver.sang@intel.com [ 38.672635][ C0] WARNING: inconsistent lock state [ 38.677619][ C0] 6.3.0-rc5-00001-g1dbf9cad3182 #1 Not tainted [ 38.683656][ C0] -------------------------------- [ 38.688647][ C0] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. [ 38.695368][ C0] systemd/1 [HC0[0]:SC1[1]:HE0:SE0] takes: [ 38.701058][ C0] ffff888877549bd8 (&xa->xa_lock#3){+.?.}-{2:2}, at: xa_destroy (lib/xarray.c:2214) [ 38.709532][ C0] {SOFTIRQ-ON-W} state was registered at: [ 38.715131][ C0] __lock_acquire (kernel/locking/lockdep.c:5010) [ 38.719875][ C0] lock_acquire (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5671 kernel/locking/lockdep.c:5634) [ 38.724339][ C0] _raw_spin_lock (include/linux/spinlock_api_smp.h:134 kernel/locking/spinlock.c:154) [ 38.728812][ C0] shmem_doff_add (include/linux/xarray.h:965 mm/shmem.c:2943) [ 38.733376][ C0] shmem_mknod (mm/shmem.c:3014) [ 38.737676][ C0] vfs_mknod (fs/namei.c:3916) [ 38.741885][ C0] devtmpfs_work_loop (drivers/base/devtmpfs.c:228 drivers/base/devtmpfs.c:393 drivers/base/devtmpfs.c:408) [ 38.746876][ C0] devtmpfsd (devtmpfs.c:?) [ 38.750913][ C0] kthread (kernel/kthread.c:376) [ 38.754950][ C0] ret_from_fork (arch/x86/entry/entry_64.S:314) [ 38.759333][ C0] irq event stamp: 3472493 [ 38.763625][ C0] hardirqs last enabled at (3472492): kasan_quarantine_put (arch/x86/include/asm/irqflags.h:42 (discriminator 1) arch/x86/include/asm/irqflags.h:77 (discriminator 1) arch/x86/include/asm/irqflags.h:135 (discriminator 1) mm/kasan/quarantine.c:242 (discriminator 1)) [ 38.773551][ C0] hardirqs last disabled at (3472493): _raw_spin_lock_irqsave (include/linux/spinlock_api_smp.h:108 kernel/locking/spinlock.c:162) [ 38.783580][ C0] softirqs last enabled at (3471804): __do_softirq (arch/x86/include/asm/preempt.h:27 kernel/softirq.c:415 kernel/softirq.c:600) [ 38.792916][ C0] softirqs last disabled at (3472447): __irq_exit_rcu (kernel/softirq.c:445 kernel/softirq.c:650) [ 38.802453][ C0] [ 38.802453][ C0] other info that might help us debug this: [ 38.810393][ C0] Possible unsafe locking scenario: [ 38.810393][ C0] [ 38.817760][ C0] CPU0 [ 38.820931][ C0] ---- [ 38.824096][ C0] lock(&xa->xa_lock#3); [ 38.828306][ C0] [ 38.831644][ C0] lock(&xa->xa_lock#3); [ 38.836027][ C0] [ 38.836027][ C0] *** DEADLOCK *** [ 38.836027][ C0] [ 38.844049][ C0] 1 lock held by systemd/1: [ 38.848459][ C0] #0: ffffffff84b2b740 (rcu_callback){....}-{0:0}, at: rcu_do_batch (include/linux/rcupdate.h:327 kernel/rcu/tree.c:2107) [ 38.857460][ C0] [ 38.857460][ C0] stack backtrace: [ 38.863234][ C0] CPU: 0 PID: 1 Comm: systemd Not tainted 6.3.0-rc5-00001-g1dbf9cad3182 #1 [ 38.871704][ C0] Hardware name: Intel Corporation Mehlow UP Server Platform/Moss Beach Server, BIOS CNLSE2R1.R00.X188.B13.1903250419 03/25/2019 [ 38.884840][ C0] Call Trace: [ 38.888010][ C0] [ 38.890738][ C0] dump_stack_lvl (lib/dump_stack.c:108) [ 38.895121][ C0] mark_lock_irq (kernel/locking/lockdep.c:3934 kernel/locking/lockdep.c:3976 kernel/locking/lockdep.c:4179) [ 38.899596][ C0] ? print_usage_bug+0x660/0x660 [ 38.905015][ C0] ? stack_trace_save (kernel/stacktrace.c:123) [ 38.909748][ C0] ? filter_irq_stacks (kernel/stacktrace.c:114) [ 38.914565][ C0] ? is_bpf_text_address (include/linux/rcupdate.h:332 include/linux/rcupdate.h:806 kernel/bpf/core.c:721) [ 38.919648][ C0] ? lock_release (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5691) [ 38.924117][ C0] ? save_trace (kernel/locking/lockdep.c:586) [ 38.928440][ C0] mark_lock+0x4ce/0xac0 [ 38.933183][ C0] ? mark_lock_irq (kernel/locking/lockdep.c:4594) [ 38.937830][ C0] mark_usage (kernel/locking/lockdep.c:4530) [ 38.941956][ C0] __lock_acquire (kernel/locking/lockdep.c:5010) [ 38.946603][ C0] ? mark_lock_irq (kernel/locking/lockdep.c:4594) [ 38.951247][ C0] ? slab_free_freelist_hook (mm/slub.c:1807) [ 38.956668][ C0] ? mark_usage (kernel/locking/lockdep.c:4914) [ 38.961057][ C0] ? __irq_exit_rcu (kernel/softirq.c:445 kernel/softirq.c:650) [ 38.965786][ C0] ? irq_exit_rcu (kernel/softirq.c:664) [ 38.970086][ C0] ? sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1107 (discriminator 14)) [ 38.975775][ C0] ? mark_usage (kernel/locking/lockdep.c:4560) [ 38.980160][ C0] lock_acquire (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5671 kernel/locking/lockdep.c:5634) [ 38.984544][ C0] ? xa_destroy (lib/xarray.c:2214) [ 38.988843][ C0] ? lock_release (kernel/locking/lockdep.c:5637) [ 38.993398][ C0] ? mark_usage (kernel/locking/lockdep.c:4914) [ 38.997819][ C0] _raw_spin_lock_irqsave (include/linux/spinlock_api_smp.h:111 kernel/locking/spinlock.c:162) [ 39.002900][ C0] ? xa_destroy (lib/xarray.c:2214) [ 39.007192][ C0] xa_destroy (lib/xarray.c:2214) [ 39.011312][ C0] ? xas_free_nodes (lib/xarray.c:2208) [ 39.016048][ C0] ? lock_release (kernel/locking/lockdep.c:5637) [ 39.020607][ C0] ? kmem_cache_free (mm/slub.c:3787 mm/slub.c:3809) [ 39.025460][ C0] shmem_free_in_core_inode (mm/shmem.c:2989 mm/shmem.c:4061) [ 39.030712][ C0] rcu_do_batch (include/linux/rcupdate.h:332 kernel/rcu/tree.c:2114) [ 39.035099][ C0] ? rcu_check_gp_kthread_starvation (kernel/rcu/tree.c:2051) [ 39.041300][ C0] ? lockdep_hardirqs_on_prepare (kernel/locking/lockdep.c:4599 kernel/locking/lockdep.c:4530) [ 39.047762][ C0] ? note_gp_changes (arch/x86/include/asm/irqflags.h:42 (discriminator 1) arch/x86/include/asm/irqflags.h:77 (discriminator 1) arch/x86/include/asm/irqflags.h:135 (discriminator 1) kernel/rcu/tree.c:1234 (discriminator 1)) [ 39.052579][ C0] rcu_core (kernel/rcu/tree.c:2374) [ 39.056616][ C0] __do_softirq (arch/x86/include/asm/jump_label.h:27 include/linux/jump_label.h:207 include/trace/events/irq.h:142 kernel/softirq.c:572) [ 39.060996][ C0] __irq_exit_rcu (kernel/softirq.c:445 kernel/softirq.c:650) [ 39.065551][ C0] irq_exit_rcu (kernel/softirq.c:664) [ 39.069674][ C0] sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1107 (discriminator 14)) [ 39.075188][ C0] [ 39.078013][ C0] [ 39.080833][ C0] asm_sysvec_apic_timer_interrupt (arch/x86/include/asm/idtentry.h:645) [ 39.086690][ C0] RIP: 0010:_raw_spin_unlock_irqrestore (kernel/locking/spinlock.c:195) [ 39.092983][ C0] Code: 89 f3 48 8b 74 24 10 48 83 c7 18 e8 81 e6 a6 fd 48 89 ef e8 e9 4e a7 fd 80 e7 02 74 06 e8 ef 70 cb fd fb 65 ff 0d 3f b3 75 7c <5b> 5d c3 0f 1f 40 00 f3 0f 1e fa 0f 1f 44 00 00 55 48 89 fd 65 ff All code ======== 0: 89 f3 mov %esi,%ebx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 83 c7 18 add $0x18,%rdi b: e8 81 e6 a6 fd callq 0xfffffffffda6e691 10: 48 89 ef mov %rbp,%rdi 13: e8 e9 4e a7 fd callq 0xfffffffffda74f01 18: 80 e7 02 and $0x2,%bh 1b: 74 06 je 0x23 1d: e8 ef 70 cb fd callq 0xfffffffffdcb7111 22: fb sti 23: 65 ff 0d 3f b3 75 7c decl %gs:0x7c75b33f(%rip) # 0x7c75b369 2a:* 5b pop %rbx <-- trapping instruction 2b: 5d pop %rbp 2c: c3 retq 2d: 0f 1f 40 00 nopl 0x0(%rax) 31: f3 0f 1e fa endbr64 35: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 3a: 55 push %rbp 3b: 48 89 fd mov %rdi,%rbp 3e: 65 gs 3f: ff .byte 0xff Code starting with the faulting instruction =========================================== 0: 5b pop %rbx 1: 5d pop %rbp 2: c3 retq 3: 0f 1f 40 00 nopl 0x0(%rax) 7: f3 0f 1e fa endbr64 b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 10: 55 push %rbp 11: 48 89 fd mov %rdi,%rbp 14: 65 gs 15: ff .byte 0xff To reproduce: git clone https://github.com/intel/lkp-tests.git cd lkp-tests sudo bin/lkp install job.yaml # job file is attached in this email bin/lkp split-job --compatible job.yaml # generate the yaml file for lkp run sudo bin/lkp run generated-yaml-file # if come across any failure that blocks the test, # please remove ~/.lkp and /lkp dir to run from a clean state. -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests