All of lore.kernel.org
 help / color / mirror / Atom feed
From: ppvk@codeaurora.org
To: Matthew Wilcox <willy@infradead.org>
Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
	stummala@codeaurora.org, sayalil@codeaurora.org
Subject: Re: [PATCH V1] fuse: Remove __GFP_FS flag to avoid allocator recursing
Date: Tue, 15 Sep 2020 20:04:10 +0530	[thread overview]
Message-ID: <9d46a88f68d7e2d0992a513688677bc0@codeaurora.org> (raw)
In-Reply-To: <20200914140733.GP6583@casper.infradead.org>

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

      reply	other threads:[~2020-09-15 14:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 13:56 [PATCH V1] fuse: Remove __GFP_FS flag to avoid allocator recursing Pradeep P V K
2020-09-14 14:07 ` Matthew Wilcox
2020-09-15 14:34   ` ppvk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d46a88f68d7e2d0992a513688677bc0@codeaurora.org \
    --to=ppvk@codeaurora.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=sayalil@codeaurora.org \
    --cc=stummala@codeaurora.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.