linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Matthew Wilcox <willy@infradead.org>
Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: Re: [LSF/MM/BPF Topic] Filesystem reclaim & memory allocation BOF
Date: Wed, 26 Mar 2025 11:55:22 -0400	[thread overview]
Message-ID: <20250326155522.GB1459574@mit.edu> (raw)
In-Reply-To: <Z-QcUwDHHfAXl9mK@casper.infradead.org>

On Wed, Mar 26, 2025 at 03:25:07PM +0000, Matthew Wilcox wrote:
> 
> We've got three reports now (two are syzkaller kiddie stuff, but one's a
> real workload) of a warning in the page allocator from filesystems
> doing reclaim.  Essentially they're using GFP_NOFAIL from reclaim
> context.  This got me thinking about bs>PS and I realised that if we fix
> this, then we're going to end up trying to do high order GFP_NOFAIL allocations
> in the memory reclaim path, and that is really no bueno.
> 
> https://lore.kernel.org/linux-mm/20250326105914.3803197-1-matt@readmodwrite.com/
> 
> I'll prepare a better explainer of the problem in advance of this.

Thanks for proposing this as a last-minute LSF/MM topic!

I was looking at this myself, and was going to reply to the mail
thread above, but I'll do it here.

From my perspective, the problem is that as part of memory reclaim,
there is an attempt to shrink the inode cache, and there are cases
where an inode's refcount was elevated (for example, because it was
referenced by a dentry), and when the dentry gets flushed, now the
inode can get evicted.  But if the inode is one that has been deleted,
then at eviction time the file system will try to release the blocks
associated with the deleted-file.  This operation will require memory
allocation, potential I/O, and perhaps waiting for a journal
transaction to complete.

So basically, there are a class of inodes where if we are in reclaim,
we should probably skip trying to evict them because there are very
likely other inodes that will be more likely to result in memory
getting released expeditiously.  And if we take a look at
inode_lru_isolate(), there's logic there already about when inodes
should skipped getting evicted.  It's probably just a matter of adding
some additional coditions there.

This seems relatively straightforward; what am I missing?

> Required attendees: Ted, Luis, Chris, Josef, other people who've wrestled
> with this before.

Happy to be there!   :-)_

						- Ted


  reply	other threads:[~2025-03-26 15:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26 15:25 Matthew Wilcox
2025-03-26 15:55 ` Theodore Ts'o [this message]
2025-03-26 16:19   ` Matthew Wilcox
2025-03-26 17:47     ` [Lsf-pc] " Jan Kara
2025-03-26 19:08       ` Chris Mason
2025-03-26 21:48 ` Dave Chinner

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=20250326155522.GB1459574@mit.edu \
    --to=tytso@mit.edu \
    --cc=clm@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=mcgrof@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox