On 2020-09-14 19:37, Matthew Wilcox wrote:
On Mon, Sep 14, 2020 at 07:26:15PM +0530, Pradeep P V K wrote:
Process#1(kswapd) held an inode lock and initaited a writeback to free
the pages, as the inode superblock is fuse, process#2 forms a fuse
request. Process#3 (Fuse daemon threads) while serving process#2
request,
it requires memory(pages) and as the system is already running in low
memory it ends up in calling try_to_ free_pages(), which might now
call
kswapd again, which is already stuck with an inode lock held. Thus
forms
a deadlock.
So, remove __GFP_FS flag to avoid allocator recursing into the
filesystem that might already held locks.
This is the wrong way to fix the problem. The fuse daemon threads
should
have called memalloc_nofs_save() as this prevents them from
inadvertently
tripping over other places where they forgot to use GFP_NOFS (or have
no way to pass a GFP_NOFS flags argument).
Thanks Matthew for pointing this. I will address this in my next patch
set.
Thanks and Regards,
Pradeep