======================================================
WARNING: possible circular locking dependency detected
6.13.0-rc7-syzkaller-00149-g9bffa1ad25b8 #0 Not tainted
------------------------------------------------------
syz.0.0/5315 is trying to acquire lock:
ffffe8ffffc37f50 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: acomp_ctx_get_cpu_lock mm/zswap.c:899 [inline]
ffffe8ffffc37f50 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: zswap_compress mm/zswap.c:931 [inline]
ffffe8ffffc37f50 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: zswap_store_page mm/zswap.c:1456 [inline]
ffffe8ffffc37f50 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: zswap_store+0xa3b/0x1c30 mm/zswap.c:1563
but task is already holding lock:
ffffffff8ea36f00 (fs_reclaim){+.+.}-{0:0}, at: __perform_reclaim mm/page_alloc.c:3926 [inline]
ffffffff8ea36f00 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_direct_reclaim+0xd4/0x3c0 mm/page_alloc.c:3951
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (fs_reclaim){+.+.}-{0:0}:
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
__fs_reclaim_acquire mm/page_alloc.c:3853 [inline]
fs_reclaim_acquire+0x88/0x130 mm/page_alloc.c:3867
might_alloc include/linux/sched/mm.h:318 [inline]
slab_pre_alloc_hook mm/slub.c:4070 [inline]
slab_alloc_node mm/slub.c:4148 [inline]
__kmalloc_cache_node_noprof+0x40/0x3a0 mm/slub.c:4337
kmalloc_node_noprof include/linux/slab.h:924 [inline]
zswap_cpu_comp_prepare+0xdc/0x400 mm/zswap.c:828
cpuhp_invoke_callback+0x415/0x830 kernel/cpu.c:204
cpuhp_issue_call+0x46f/0x7e0
__cpuhp_state_add_instance_cpuslocked+0x1ed/0x500 kernel/cpu.c:2437
__cpuhp_state_add_instance+0x27/0x40 kernel/cpu.c:2458
cpuhp_state_add_instance include/linux/cpuhotplug.h:386 [inline]
zswap_pool_create+0x38c/0x680 mm/zswap.c:291
zswap_setup+0x32a/0x4b0 mm/zswap.c:1811
do_one_initcall+0x248/0x870 init/main.c:1266
do_initcall_level+0x157/0x210 init/main.c:1328
do_initcalls+0x3f/0x80 init/main.c:1344
kernel_init_freeable+0x435/0x5d0 init/main.c:1577
kernel_init+0x1d/0x2b0 init/main.c:1466
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
-> #0 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3161 [inline]
check_prevs_add kernel/locking/lockdep.c:3280 [inline]
validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
__lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
__mutex_lock_common kernel/locking/mutex.c:585 [inline]
__mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735
acomp_ctx_get_cpu_lock mm/zswap.c:899 [inline]
zswap_compress mm/zswap.c:931 [inline]
zswap_store_page mm/zswap.c:1456 [inline]
zswap_store+0xa3b/0x1c30 mm/zswap.c:1563
swap_writepage+0x647/0xce0 mm/page_io.c:279
shmem_writepage+0x1248/0x1610 mm/shmem.c:1579
pageout mm/vmscan.c:696 [inline]
shrink_folio_list+0x3b68/0x5ca0 mm/vmscan.c:1374
evict_folios+0x3c92/0x58c0 mm/vmscan.c:4600
try_to_shrink_lruvec+0x9a6/0xc70 mm/vmscan.c:4799
shrink_one+0x3b9/0x850 mm/vmscan.c:4844
shrink_many mm/vmscan.c:4907 [inline]
lru_gen_shrink_node mm/vmscan.c:4985 [inline]
shrink_node+0x37c5/0x3e50 mm/vmscan.c:5966
shrink_zones mm/vmscan.c:6225 [inline]
do_try_to_free_pages+0x78c/0x1cf0 mm/vmscan.c:6287
try_to_free_pages+0x47c/0x1050 mm/vmscan.c:6537
__perform_reclaim mm/page_alloc.c:3929 [inline]
__alloc_pages_direct_reclaim+0x178/0x3c0 mm/page_alloc.c:3951
__alloc_pages_slowpath+0x764/0x1020 mm/page_alloc.c:4382
__alloc_pages_noprof+0x49b/0x710 mm/page_alloc.c:4766
alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269
relay_alloc_buf kernel/relay.c:121 [inline]
relay_create_buf kernel/relay.c:162 [inline]
relay_open_buf+0x2bd/0xd60 kernel/relay.c:384
relay_open+0x3aa/0x890 kernel/relay.c:517
do_blk_trace_setup+0x573/0x9b0 kernel/trace/blktrace.c:590
__blk_trace_setup kernel/trace/blktrace.c:630 [inline]
blk_trace_ioctl+0x359/0x9a0 kernel/trace/blktrace.c:740
blkdev_ioctl+0x40c/0x6a0 block/ioctl.c:682
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(fs_reclaim);
lock(&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex);
lock(fs_reclaim);
lock(&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex);
*** DEADLOCK ***
3 locks held by syz.0.0/5315:
#0: ffff888034bf5758 (&q->debugfs_mutex){+.+.}-{4:4}, at: blk_trace_ioctl+0xdd/0x9a0 kernel/trace/blktrace.c:735
#1: ffffffff8e98aaa8 (relay_channels_mutex){+.+.}-{4:4}, at: relay_open+0x338/0x890 kernel/relay.c:515
#2: ffffffff8ea36f00 (fs_reclaim){+.+.}-{0:0}, at: __perform_reclaim mm/page_alloc.c:3926 [inline]
#2: ffffffff8ea36f00 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_direct_reclaim+0xd4/0x3c0 mm/page_alloc.c:3951
stack backtrace:
CPU: 0 UID: 0 PID: 5315 Comm: syz.0.0 Not tainted 6.13.0-rc7-syzkaller-00149-g9bffa1ad25b8 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074
check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206
check_prev_add kernel/locking/lockdep.c:3161 [inline]
check_prevs_add kernel/locking/lockdep.c:3280 [inline]
validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
__lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
__mutex_lock_common kernel/locking/mutex.c:585 [inline]
__mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735
acomp_ctx_get_cpu_lock mm/zswap.c:899 [inline]
zswap_compress mm/zswap.c:931 [inline]
zswap_store_page mm/zswap.c:1456 [inline]
zswap_store+0xa3b/0x1c30 mm/zswap.c:1563
swap_writepage+0x647/0xce0 mm/page_io.c:279
shmem_writepage+0x1248/0x1610 mm/shmem.c:1579
pageout mm/vmscan.c:696 [inline]
shrink_folio_list+0x3b68/0x5ca0 mm/vmscan.c:1374
evict_folios+0x3c92/0x58c0 mm/vmscan.c:4600
try_to_shrink_lruvec+0x9a6/0xc70 mm/vmscan.c:4799
shrink_one+0x3b9/0x850 mm/vmscan.c:4844
shrink_many mm/vmscan.c:4907 [inline]
lru_gen_shrink_node mm/vmscan.c:4985 [inline]
shrink_node+0x37c5/0x3e50 mm/vmscan.c:5966
shrink_zones mm/vmscan.c:6225 [inline]
do_try_to_free_pages+0x78c/0x1cf0 mm/vmscan.c:6287
try_to_free_pages+0x47c/0x1050 mm/vmscan.c:6537
__perform_reclaim mm/page_alloc.c:3929 [inline]
__alloc_pages_direct_reclaim+0x178/0x3c0 mm/page_alloc.c:3951
__alloc_pages_slowpath+0x764/0x1020 mm/page_alloc.c:4382
__alloc_pages_noprof+0x49b/0x710 mm/page_alloc.c:4766
alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269
relay_alloc_buf kernel/relay.c:121 [inline]
relay_create_buf kernel/relay.c:162 [inline]
relay_open_buf+0x2bd/0xd60 kernel/relay.c:384
relay_open+0x3aa/0x890 kernel/relay.c:517
do_blk_trace_setup+0x573/0x9b0 kernel/trace/blktrace.c:590
__blk_trace_setup kernel/trace/blktrace.c:630 [inline]
blk_trace_ioctl+0x359/0x9a0 kernel/trace/blktrace.c:740
blkdev_ioctl+0x40c/0x6a0 block/ioctl.c:682
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc2c1f85d29
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc2c2de2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc2c2175fa0 RCX: 00007fc2c1f85d29
RDX: 0000000020002140 RSI: 00000000c0481273 RDI: 0000000000000003
RBP: 00007fc2c2001b08 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fc2c2175fa0 R15: 00007fff7f0e8b68
syz.0.0: page allocation failure: order:0, mode:0xcc0(GFP_KERNEL), nodemask=(null),cpuset=/,mems_allowed=0-1
CPU: 0 UID: 0 PID: 5315 Comm: syz.0.0 Not tainted 6.13.0-rc7-syzkaller-00149-g9bffa1ad25b8 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
warn_alloc+0x278/0x410 mm/page_alloc.c:3550
__alloc_pages_slowpath+0xf37/0x1020 mm/page_alloc.c:4484
__alloc_pages_noprof+0x49b/0x710 mm/page_alloc.c:4766
alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269
relay_alloc_buf kernel/relay.c:121 [inline]
relay_create_buf kernel/relay.c:162 [inline]
relay_open_buf+0x2bd/0xd60 kernel/relay.c:384
relay_open+0x3aa/0x890 kernel/relay.c:517
do_blk_trace_setup+0x573/0x9b0 kernel/trace/blktrace.c:590
__blk_trace_setup kernel/trace/blktrace.c:630 [inline]
blk_trace_ioctl+0x359/0x9a0 kernel/trace/blktrace.c:740
blkdev_ioctl+0x40c/0x6a0 block/ioctl.c:682
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:906 [inline]
__se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc2c1f85d29
Code: Unable to access opcode bytes at 0x7fc2c1f85cff.
RSP: 002b:00007fc2c2de2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc2c2175fa0 RCX: 00007fc2c1f85d29
RDX: 0000000020002140 RSI: 00000000c0481273 RDI: 0000000000000003
RBP: 00007fc2c2001b08 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fc2c2175fa0 R15: 00007fff7f0e8b68
Mem-Info:
active_anon:0 inactive_anon:2 isolated_anon:0
active_file:0 inactive_file:11 isolated_file:0
unevictable:1768 dirty:0 writeback:0
slab_reclaimable:6957 slab_unreclaimable:29985
mapped:8193 shmem:1768 pagetables:427
sec_pagetables:285 bounce:0
kernel_misc_reclaimable:0
free:4633 free_pcp:1084 free_cma:0
Node 0 active_anon:0kB inactive_anon:8kB active_file:0kB inactive_file:20kB unevictable:1536kB isolated(anon):0kB isolated(file):0kB mapped:4kB dirty:0kB writeback:0kB shmem:1536kB shmem_thp:0kB shmem_pmdmapped:0kB anon_thp:0kB writeback_tmp:0kB kernel_stack:3048kB pagetables:476kB sec_pagetables:1088kB all_unreclaimable? yes
Node 1 active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:24kB unevictable:5536kB isolated(anon):0kB isolated(file):0kB mapped:32768kB dirty:0kB writeback:0kB shmem:5536kB shmem_thp:0kB shmem_pmdmapped:0kB anon_thp:0kB writeback_tmp:0kB kernel_stack:6232kB pagetables:1232kB sec_pagetables:52kB all_unreclaimable? yes
Node 0 DMA free:532kB boost:2048kB min:2808kB low:2996kB high:3184kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15360kB mlocked:0kB bounce:0kB free_pcp:124kB local_pcp:124kB free_cma:0kB
lowmem_reserve[]: 0 86 0 0 0
Node 0 DMA32 free:2876kB boost:2048kB min:6456kB low:7556kB high:8656kB reserved_highatomic:0KB active_anon:0kB inactive_anon:8kB active_file:0kB inactive_file:20kB unevictable:1536kB writepending:0kB present:770052kB managed:116896kB mlocked:0kB bounce:0kB free_pcp:172kB local_pcp:172kB free_cma:0kB
lowmem_reserve[]: 0 0 0 0 0
Node 1 DMA32 free:14932kB boost:0kB min:34308kB low:42884kB high:51460kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:24kB unevictable:5536kB writepending:0kB present:786288kB managed:690876kB mlocked:0kB bounce:0kB free_pcp:4148kB local_pcp:4148kB free_cma:0kB
lowmem_reserve[]: 0 0 0 0 0
Node 0 DMA: 22*4kB (E) 27*8kB (E) 14*16kB (E) 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 528kB
Node 0 DMA32: 3*4kB (ME) 3*8kB (UM) 3*16kB (ME) 3*32kB (UM) 0*64kB 3*128kB (UM) 3*256kB (UM) 3*512kB (UM) 0*1024kB 0*2048kB 0*4096kB = 2868kB
Node 1 DMA32: 9*4kB (UM) 6*8kB (M) 6*16kB (UM) 6*32kB (M) 7*64kB (M) 8*128kB (UM) 7*256kB (UM) 6*512kB (UM) 6*1024kB (UM) 1*2048kB (M) 0*4096kB = 14900kB
Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
Node 0 hugepages_total=2 hugepages_free=2 hugepages_surp=0 hugepages_size=2048kB
Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
Node 1 hugepages_total=2 hugepages_free=2 hugepages_surp=0 hugepages_size=2048kB
1787 total pagecache pages
0 pages in swap cache
Free swap = 113932kB
Total swap = 124996kB
393083 pages RAM
0 pages HighMem/MovableOnly
187300 pages reserved
0 pages cma reserved
syz.0.0 (5315) used greatest stack depth: 17520 bytes left