================================ WARNING: inconsistent lock state 6.4.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. kworker/3:2/18006 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff88817fffc728 (&pgdat->memcg_lru.lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] ffff88817fffc728 (&pgdat->memcg_lru.lock){+.?.}-{2:2}, at: lru_gen_rotate_memcg+0x64/0xab0 mm/vmscan.c:4734 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] lru_gen_online_memcg+0x16b/0x5a0 mm/vmscan.c:4782 mem_cgroup_css_online+0x227/0x3b0 mm/memcontrol.c:5468 online_css+0xaf/0x2a0 kernel/cgroup/cgroup.c:5505 cgroup_init_subsys+0x46b/0x900 kernel/cgroup/cgroup.c:6036 cgroup_init+0xb83/0x1090 kernel/cgroup/cgroup.c:6120 start_kernel+0x398/0x490 init/main.c:1077 x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:556 x86_64_start_kernel+0xb3/0xc0 arch/x86/kernel/head64.c:537 secondary_startup_64_no_verify+0xf4/0xfb irq event stamp: 801935 hardirqs last enabled at (801934): [] mod_memcg_state include/linux/memcontrol.h:982 [inline] hardirqs last enabled at (801934): [] memcg_account_kmem+0x4f/0x80 mm/memcontrol.c:3094 hardirqs last disabled at (801935): [] uncharge_batch+0x1c7/0x560 mm/memcontrol.c:7142 softirqs last enabled at (801272): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (801272): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 softirqs last disabled at (801839): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (801839): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&pgdat->memcg_lru.lock); lock(&pgdat->memcg_lru.lock); *** DEADLOCK *** 3 locks held by kworker/3:2/18006: #0: ffff888012469d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888012469d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888012469d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1324 [inline] #0: ffff888012469d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:643 [inline] #0: ffff888012469d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:670 [inline] #0: ffff888012469d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x883/0x15e0 kernel/workqueue.c:2379 #1: ffffc9000a1c7db0 ((work_completion)(&pwq->unbound_release_work)){+.+.}-{0:0}, at: process_one_work+0x8b7/0x15e0 kernel/workqueue.c:2383 #2: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2104 [inline] #2: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_core+0x791/0x1ad0 kernel/rcu/tree.c:2377 stack backtrace: CPU: 3 PID: 18006 Comm: kworker/3:2 Not tainted 6.4.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: events pwq_unbound_release_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:3949 [inline] valid_state kernel/locking/lockdep.c:3991 [inline] mark_lock_irq kernel/locking/lockdep.c:4194 [inline] mark_lock.part.0+0x1110/0x1970 kernel/locking/lockdep.c:4656 mark_lock kernel/locking/lockdep.c:4620 [inline] mark_usage kernel/locking/lockdep.c:4545 [inline] __lock_acquire+0x1227/0x5f30 kernel/locking/lockdep.c:5042 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] lru_gen_rotate_memcg+0x64/0xab0 mm/vmscan.c:4734 lru_gen_soft_reclaim+0x62/0x70 mm/vmscan.c:4837 uncharge_batch+0x2be/0x560 mm/memcontrol.c:7145 __mem_cgroup_uncharge+0x11f/0x290 mm/memcontrol.c:7221 mem_cgroup_uncharge include/linux/memcontrol.h:698 [inline] __folio_put_small mm/swap.c:105 [inline] __folio_put+0xb6/0x140 mm/swap.c:129 folio_put include/linux/mm.h:1430 [inline] put_page include/linux/mm.h:1499 [inline] free_page_and_swap_cache+0x257/0x2c0 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:34 [inline] __tlb_remove_table_free mm/mmu_gather.c:153 [inline] tlb_remove_table_rcu+0x89/0xe0 mm/mmu_gather.c:208 rcu_do_batch kernel/rcu/tree.c:2115 [inline] rcu_core+0x806/0x1ad0 kernel/rcu/tree.c:2377 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:lockdep_unregister_key+0x27d/0x460 kernel/locking/lockdep.c:6426 Code: e8 28 df ff ff 4c 89 e7 e8 20 c5 ff ff e8 cb c5 ff ff 9c 58 f6 c4 02 0f 85 43 01 00 00 41 f7 c6 00 02 00 00 0f 85 ec 00 00 00 de c4 09 00 48 b8 00 00 00 00 00 fc ff df 49 c7 44 05 00 00 00 RSP: 0018:ffffc9000a1c7c40 EFLAGS: 00000206 RAX: 0000000000000046 RBX: ffff88802bd74128 RCX: 0000000000000001 RDX: dffffc0000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff88802bd74128 R08: 0000000000000001 R09: ffffffff90191e16 R10: fffffbfff22a32e2 R11: 000000000001ca2b R12: ffffffff91518cc8 R13: 1ffff92001438f89 R14: 0000000000000246 R15: ffffffff916a1b90 wq_unregister_lockdep kernel/workqueue.c:3618 [inline] pwq_unbound_release_workfn+0x258/0x340 kernel/workqueue.c:3866 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2408 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2555 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 ---------------- Code disassembly (best guess): 0: e8 28 df ff ff callq 0xffffdf2d 5: 4c 89 e7 mov %r12,%rdi 8: e8 20 c5 ff ff callq 0xffffc52d d: e8 cb c5 ff ff callq 0xffffc5dd 12: 9c pushfq 13: 58 pop %rax 14: f6 c4 02 test $0x2,%ah 17: 0f 85 43 01 00 00 jne 0x160 1d: 41 f7 c6 00 02 00 00 test $0x200,%r14d 24: 0f 85 ec 00 00 00 jne 0x116 * 2a: e8 de c4 09 00 callq 0x9c50d <-- trapping instruction 2f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 36: fc ff df 39: 49 rex.WB 3a: c7 .byte 0xc7 3b: 44 rex.R 3c: 05 .byte 0x5 3d: 00 00 add %al,(%rax)