linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Dave Chinner <david@fromorbit.com>, Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	rgoldwyn@suse.de, neilb@suse.com,
	James.Bottomley@HansenPartnership.com,
	Michal Hocko <mhocko@kernel.org>
Subject: Re: Removing GFP_NOFS
Date: Fri, 9 Mar 2018 20:14:13 +0900	[thread overview]
Message-ID: <5340fdd1-a6ea-0464-84a0-27b4dd1460c9@i-love.sakura.ne.jp> (raw)
In-Reply-To: <20180309040650.GV7000@dastard>

On 2018/03/09 13:06, Dave Chinner wrote:
> On Fri, Mar 09, 2018 at 12:35:35PM +1100, Dave Chinner wrote:
>> On Thu, Mar 08, 2018 at 03:46:18PM -0800, Matthew Wilcox wrote:
>>>
>>> Do we have a strategy for eliminating GFP_NOFS?
>>>
>>> As I understand it, our intent is to mark the areas in individual
>>> filesystems that can't be reentered with memalloc_nofs_save()/restore()
>>> pairs.A  Once they're all done, then we can replace all the GFP_NOFS
>>> users with GFP_KERNEL.
>>
>> Won't be that easy, I think.A  We recently came across user-reported
>> allocation deadlocks in XFS where we were doing allocation with
>> pages held in the writeback state that lockdep has never triggered
>> on.
>>
>> https://www.spinics.net/lists/linux-xfs/msg16154.html
>>
>> IOWs, GFP_NOFS isn't a solid guide to where
>> memalloc_nofs_save/restore need to cover in the filesystems because
>> there's a surprising amount of code that isn't covered by existing
>> lockdep annotations to warning us about un-intended recursion
>> problems.
>>
>> I think we need to start with some documentation of all the generic
>> rules for where these will need to be set, then the per-filesystem
>> rules can be added on top of that...
>
> So thinking a bit further here:
>
> * page writeback state gets set and held:
> A A A  ->writepage should be under memalloc_nofs_save
> A A A  ->writepages should be under memalloc_nofs_save
> * page cache write path is often under AOP_FLAG_NOFS
> A A A  - should probably be under memalloc_nofs_save
> * metadata writeback that uses page cache and page writeback flags
>A A  should probably be under memalloc_nofs_save
>
> What other generic code paths are susceptible to allocation
> deadlocks?
>
> Cheers,
>
> Dave.

Goldwyn Rodrigues is thinking "[LSF/MM ATTEND] memory allocation scope".
But I think that getting rid of direct reclaim, assigning dedicated kernel
thread for each reclaim routine, and using multiple watermark levels based
on purpose of memory allocation request is the better. OOM situation is
wasting CPU resources by unthrottled direct reclaim attempts without making
progress, and we are loosing performance when memory allocation for memory
reclaim activities are failing, and happily diving into the lockdep
labyrinth which is too hard to test, and we are unable to give up upon
SIGKILL (i.e. unable to implement __GFP_KILLABLE) due to unkillable locks
within direct reclaim attempts.

  reply	other threads:[~2018-03-09 11:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 23:46 Matthew Wilcox
2018-03-09  1:35 ` Dave Chinner
2018-03-09  4:06   ` Dave Chinner
2018-03-09 11:14     ` Tetsuo Handa [this message]
2018-03-09 14:48     ` Goldwyn Rodrigues
2018-03-09 22:38       ` Dave Chinner
2018-03-10  2:44         ` Tetsuo Handa

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=5340fdd1-a6ea-0464-84a0-27b4dd1460c9@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=neilb@suse.com \
    --cc=rgoldwyn@suse.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox