From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BADCC3600C for ; Thu, 3 Apr 2025 17:12:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B867280006; Thu, 3 Apr 2025 13:12:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 342B0280005; Thu, 3 Apr 2025 13:12:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BA78280006; Thu, 3 Apr 2025 13:12:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EF544280005 for ; Thu, 3 Apr 2025 13:12:34 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C69A8B9BB4 for ; Thu, 3 Apr 2025 17:12:35 +0000 (UTC) X-FDA: 83293376670.03.C12F37D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 9D6D0120006 for ; Thu, 3 Apr 2025 17:12:32 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Lff1NApR; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743700354; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=F/Huv1u3N8Ic31zYcjSkVat6RRJDswmpX0g1d52/EhY=; b=r2gWXkRYASuTyvaYM19qTxTkB0CDjsrKu7IG5/CXyvrW+uLl5K3D7XFtarScglmdR+eVDn pl4db0N8HD9lO40BI9jTH/Euh8h+OR5H/MvxI7RePbrXpPZVxQyaPKpw3xxeoSUtnOJEKK hlDcbRm3P/do8xi/BHkhkPndPZZDW1U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743700354; a=rsa-sha256; cv=none; b=8ol8F5RwKsMMi+GYFpuPXoCYUrJAL/BbvN4GSqyLx+4qK6X/Z2elYB5Q6/348FfZsS2ZuA n3v4z1O+9rDzMEHgn2FiMSFafjchDd/QNQlU786QOkEngDh0fcZPQ4gINu8tIxoe8zOzfJ ynKr9nKEQiaVsGlFuXPjdaTpcYZo0Ts= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Lff1NApR; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=F/Huv1u3N8Ic31zYcjSkVat6RRJDswmpX0g1d52/EhY=; b=Lff1NApRveWFI0pHa7VtFfnSIL YonUoUpFlqcynPi+DSS5aZ0uLB1NlbC8JB8YynvwvDpFnj4GawFv9pOPtaSeSaxkMkNxez62iitoR EGDbRyhQciYbKDm9la7lGll9DZpY1oBCE0S8a/zh6C29reHXyzugC/cvfQa+uws1ft97SuRAdakMD AfJgkHa+pxL6mlN+YmivT++4mfax91L2OA83qGV8i/XhbMXgYzolnQP+GZz524JPSw5qeBEyZAWVD co0rkj4yRcCk4JsB/Yq9IgWBKlKcg/0mtu3sG86wckKXTI6X2joIolQYIYS9YsLj0uqLn23R4mWrF mDapSljg==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1u0O78-0000000DMVH-41Zr; Thu, 03 Apr 2025 17:12:27 +0000 Date: Thu, 3 Apr 2025 18:12:26 +0100 From: Matthew Wilcox To: Matt Fleming 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 , kernel-team@cloudflare.com, Vlastimil Babka , Miklos Szeredi , Amir Goldstein , Dave Chinner , Qi Zheng , Roman Gushchin , Muchun Song Subject: Re: Potential Linux Crash: WARNING in ext4_dirty_folio in Linux kernel v6.13-rc5 Message-ID: References: <20250326105914.3803197-1-matt@readmodwrite.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Stat-Signature: r66m1jb4yeiht5q18w3k1we4murzzdkm X-Rspam-User: X-Rspamd-Queue-Id: 9D6D0120006 X-Rspamd-Server: rspam08 X-HE-Tag: 1743700352-441970 X-HE-Meta: U2FsdGVkX1/u83kjr/iJfpK2FnrXGwC43ONXRrzxUJbQo5BeRMcxQiAUtbNSZIGkBWtqpOqQCfAzi2rF5Vq5aptOkg2Yy9gh/DvabcTyJNIAKOYBztnept/dR/1k7HHBHwWy4jtxhIqbUQSLPvwkG8qKnobiroJ13j3+KAAW5p5aCJYmw76Ya1vRkCejnVHKHVziXN+0QSPfaF9A8GKzfIO2o86zH49ZbwX3JlpLD0qou+kio4DrONuEEHvaWeyejFeqncsrGHVHNf4dD0ay3bni1p54ztX5ZwD5wYSnZ/pdVYk6sLqvem3yRcRDUkLgmwpEkRLIrTU4WuwbybjR43A98KjmM5IEZa0uPfgNcPcfHu8cXyqcAEMLMtxBkb7c75w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.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Apr 03, 2025 at 01:29:44PM +0100, Matt Fleming wrote: > On Wed, Mar 26, 2025 at 10:59 AM Matt Fleming 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.