From: Matthew Wilcox <willy@infradead.org>
To: Matt Fleming <matt@readmodwrite.com>
Cc: adilger.kernel@dilger.ca, akpm@linux-foundation.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
luka.2016.cs@gmail.com, tytso@mit.edu,
Barry Song <baohua@kernel.org>,
kernel-team@cloudflare.com, Vlastimil Babka <vbabka@suse.cz>,
Miklos Szeredi <miklos@szeredi.hu>,
Amir Goldstein <amir73il@gmail.com>,
Dave Chinner <david@fromorbit.com>,
Qi Zheng <zhengqi.arch@bytedance.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>
Subject: Re: Potential Linux Crash: WARNING in ext4_dirty_folio in Linux kernel v6.13-rc5
Date: Thu, 3 Apr 2025 18:12:26 +0100 [thread overview]
Message-ID: <Z-7BengoC1j6WQBE@casper.infradead.org> (raw)
In-Reply-To: <CAENh_SSbkoa3srjkAMmJuf-iTFxHOtwESHoXiPAu6bO7MLOkDA@mail.gmail.com>
On Thu, Apr 03, 2025 at 01:29:44PM +0100, Matt Fleming wrote:
> On Wed, Mar 26, 2025 at 10:59 AM Matt Fleming <matt@readmodwrite.com> wrote:
> >
> > Hi there,
> >
> > I'm also seeing this PF_MEMALLOC WARN triggered from kswapd in 6.12.19.
> >
> > Does overlayfs need some kind of background inode reclaim support?
>
> Hey everyone, I know there was some off-list discussion last week at
> LSFMM, but I don't think a definite solution has been proposed for the
> below stacktrace.
Hi Matt,
We did have a substantial discussion at LSFMM and we just had another
discussion on the ext4 call. I'm going to try to summarise those
discussions here, and people can jump in to correct me (I'm not really
an expert on this part of MM-FS interaction).
At LSFMM, we came up with a solution that doesn't work, so let's start
with ideas that don't work:
- Allow PF_MEMALLOC to dip into the atomic reserves. With large block
devices, we might end up doing emergency high-order allocations, and
that makes everybody nervous
- Only allow inode reclaim from kswapd and not from direct reclaim.
Your stack trace here is from kswapd, so obviously that doesn't work.
- Allow ->evict_inode to return an error. At this point the inode has
been taken off the lists which means that somebody else may have
started to start constructing it again, and we can't just put it back
on the lists.
Jan explained that _usually_ the reclaim path is not the last holder of
a reference to the inode. What's happening here is that we've lost a
race where the dentry is being turned negative by somebody else at the
same time, and usually they'd have the last reference and call evict.
But if the shrinker has the last reference, it has to do the eviction.
Jan does not think that Overlayfs is a factor here. It may change the
timing somewhat but should not make the race wider (nor narrower).
Ideas still on the table:
- Convert all filesystems to use the XFS inode management scheme.
Nobody is thrilled by this large amount of work.
- Find a simpler version of the XFS scheme to implement for other
filesystems.
next prev parent reply other threads:[~2025-04-03 17:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 2:42 Potential Linux Crash: WARNING in ext4_dirty_folio in Linux kernel v6.13-rc5 Luka
2025-03-06 5:13 ` Matthew Wilcox
2025-03-26 10:59 ` Matt Fleming
2025-04-03 12:29 ` Matt Fleming
2025-04-03 12:58 ` Vlastimil Babka
2025-04-03 14:33 ` Michal Hocko
2025-04-03 17:12 ` Matthew Wilcox [this message]
2025-04-03 19:32 ` James Bottomley
2025-04-04 9:09 ` Vlastimil Babka
2025-04-04 13:50 ` Matthew Wilcox
2025-04-07 23:00 ` 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=Z-7BengoC1j6WQBE@casper.infradead.org \
--to=willy@infradead.org \
--cc=adilger.kernel@dilger.ca \
--cc=akpm@linux-foundation.org \
--cc=amir73il@gmail.com \
--cc=baohua@kernel.org \
--cc=david@fromorbit.com \
--cc=kernel-team@cloudflare.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luka.2016.cs@gmail.com \
--cc=matt@readmodwrite.com \
--cc=miklos@szeredi.hu \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=tytso@mit.edu \
--cc=vbabka@suse.cz \
--cc=zhengqi.arch@bytedance.com \
/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;
as well as URLs for NNTP newsgroup(s).