Re:[PATCH] fuse: alloc_page nofs avoid deadlock

From: chenguanyou
Date: Tue Jun 08 2021 - 10:55:03 EST


ABCA deadlock

kswapd0 D 0 159 2 0x00000000
Call trace:
__switch_to+0x134/0x150
__schedule+0x12ac/0x172c
schedule+0x70/0x90
bit_wait+0x14/0x54
__wait_on_bit+0x74/0xe0
inode_wait_for_writeback+0xa0/0xe4
evict+0xa4/0x298
iput+0x33c/0x38c
dentry_unlink_inode+0xd8/0xe4
__dentry_kill+0xe8/0x22c
shrink_dentry_list+0x1e8/0x4f0
prune_dcache_sb+0x54/0x80
super_cache_scan+0x114/0x164
shrink_slab+0x5f8/0x708
shrink_node+0x144/0x318
kswapd+0xa10/0xc24
kthread+0x124/0x134
ret_from_fork+0x10/0x18


Thread-5 D 0 3396 698 0x01000808
Call trace:
__switch_to+0x134/0x150
__schedule+0x12ac/0x172c
schedule+0x70/0x90
try_to_free_pages+0x280/0x67c
__alloc_pages_nodemask+0x918/0x145c
fuse_copy_fill+0x15c/0x210
fuse_dev_do_read+0x4e8/0xcd4
fuse_dev_splice_read+0x84/0x1d8
SyS_splice+0x6ac/0x8fc
__sys_trace_return+0x0/0x4


u:r:kernel:s0 root 159 159 2 0 0 inode_wait_for_writeback 0 D 19 0 - 0 fg 6 [kswapd0] kswapd0
u:r:kernel:s0 root 25798 25798 2 0 0 __fuse_request_send 0 S 19 0 - 0 fg 2 [kworker/u16:0] kworker/u16:0
u:r:mediaprovider_app:s0:c203,c256,c512,c768 u0_a203 3254 3396 698 5736296 62012 try_to_free_pages 0 D 19 0 - 0 ta 4 com.android.providers.media.module Thread-5