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@xxxxxxxxxxxxxxxx> 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.