================================ WARNING: inconsistent lock state 6.4.0-rc7-syzkaller-00067-g2214170caabb #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. kcompactd0/44 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff88807ffdc728 (&pgdat->memcg_lru.lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] ffff88807ffdc728 (&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:5491 cgroup_init_subsys+0x46b/0x900 kernel/cgroup/cgroup.c:6022 cgroup_init+0xb83/0x1090 kernel/cgroup/cgroup.c:6106 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: 194683 hardirqs last enabled at (194682): [] mod_memcg_state include/linux/memcontrol.h:982 [inline] hardirqs last enabled at (194682): [] memcg_account_kmem+0x4f/0x80 mm/memcontrol.c:3094 hardirqs last disabled at (194683): [] uncharge_batch+0x1c7/0x560 mm/memcontrol.c:7142 softirqs last enabled at (192008): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (192008): [] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 softirqs last disabled at (194653): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (194653): [] __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 *** 1 lock held by kcompactd0/44: #0: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2104 [inline] #0: ffffffff8c796020 (rcu_callback){....}-{0:0}, at: rcu_core+0x791/0x1ad0 kernel/rcu/tree.c:2377 stack backtrace: CPU: 0 PID: 44 Comm: kcompactd0 Not tainted 6.4.0-rc7-syzkaller-00067-g2214170caabb #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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:clear_page_erms+0xb/0x10 arch/x86/lib/clear_page_64.S:50 Code: 48 89 47 20 48 89 47 28 48 89 47 30 48 89 47 38 48 8d 7f 40 75 d9 90 c3 0f 1f 80 00 00 00 00 f3 0f 1e fa b9 00 10 00 00 31 c0 aa c3 66 90 f3 0f 1e fa 48 83 f9 40 73 36 83 f9 08 73 0f 85 c9 RSP: 0018:ffffc90000bdf3e0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000100 RDX: ffffea0000fa0900 RSI: ffff888000000000 RDI: ffff88803e824f00 RBP: ffffea0000fa0000 R08: 0000160000000000 R09: ffffea0000fa1000 R10: ffffed1007d00000 R11: 0000000000094001 R12: 0000000000000040 R13: 0000000000000006 R14: 0000000000000001 R15: 0000000000000000 clear_page arch/x86/include/asm/page_64.h:53 [inline] clear_highpage_kasan_tagged include/linux/highmem.h:248 [inline] kernel_init_pages mm/page_alloc.c:1237 [inline] post_alloc_hook+0x1b9/0x350 mm/page_alloc.c:1729 split_map_pages+0x1ef/0x520 mm/compaction.c:97 isolate_freepages mm/compaction.c:1680 [inline] compaction_alloc+0x168a/0x2350 mm/compaction.c:1694 migrate_folio_unmap mm/migrate.c:1131 [inline] migrate_pages_batch+0x3d3/0x3020 mm/migrate.c:1674 migrate_pages_sync mm/migrate.c:1867 [inline] migrate_pages+0x1c13/0x27d0 mm/migrate.c:1970 compact_zone+0x1c98/0x39a0 mm/compaction.c:2439 proactive_compact_node+0x103/0x1b0 mm/compaction.c:2702 kcompactd+0x837/0xcc0 mm/compaction.c:3003 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 ---------------- Code disassembly (best guess): 0: 48 89 47 20 mov %rax,0x20(%rdi) 4: 48 89 47 28 mov %rax,0x28(%rdi) 8: 48 89 47 30 mov %rax,0x30(%rdi) c: 48 89 47 38 mov %rax,0x38(%rdi) 10: 48 8d 7f 40 lea 0x40(%rdi),%rdi 14: 75 d9 jne 0xffffffef 16: 90 nop 17: c3 retq 18: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 1f: f3 0f 1e fa endbr64 23: b9 00 10 00 00 mov $0x1000,%ecx 28: 31 c0 xor %eax,%eax * 2a: f3 aa rep stos %al,%es:(%rdi) <-- trapping instruction 2c: c3 retq 2d: 66 90 xchg %ax,%ax 2f: f3 0f 1e fa endbr64 33: 48 83 f9 40 cmp $0x40,%rcx 37: 73 36 jae 0x6f 39: 83 f9 08 cmp $0x8,%ecx 3c: 73 0f jae 0x4d 3e: 85 c9 test %ecx,%ecx