From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FC91606A31C for ; Mon, 30 Nov 2026 00:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IQYF8ebj Received: by kanga.kvack.org (Postfix) id 1B7286B05B0; Sun, 29 Nov 2026 19:24:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 167D46B05B4; Sun, 29 Nov 2026 19:24:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07E2D6B05B5; Sun, 29 Nov 2026 19:24:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 83BDA6B05B0 for ; Sun, 29 Nov 2026 19:24:44 -0500 (EST) Received: from smtpin07.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EC31B12086F for ; Mon, 30 Nov 2026 00:24:43 +0000 (UTC) X-FDA: 85489889646.07.EF09A68 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf24.hostedemail.com (Postfix) with ESMTP id 5FACE18000C for ; Mon, 30 Nov 2026 00:24:42 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=IQYF8ebj; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1795998282; b=5vYlrWNHEZZ+N2lenqG1UwWS23FOeF/OiMgiTF1Sq+S5vf8nYDr7cAQZNJ/ReVxbaRpmqn R3UkzAMgHnrN76NpHXXcDV7loKIey5LJ3zFHVqj4jJV36y3IYTu4YLig8t/WgjC4pEein5 JJFOlAHOCVkT3OUlbusbPQVyAp1Vv00= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1795998282; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Ux/Wqe8UchsX/PhWcw7tdXZRndxMBKHrzh6LwRkGTaE=; b=aXvLllGSfOElMcvPQbTPx1dhhDQbap2MzcRsVYoO25yQxfT8eGMdphecBW4XQtETZJpKd7 FwzXy95eZ+61Cb8GgJYiUDLZWulhDoQ59pY30Mvjt0+vaivANEzrSiqpMSnSDC+MPXhG6j ruc712tBKbfEOf5QsaO+0DbXJDJlCX4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=IQYF8ebj; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 8F87661223; Mon, 30 Nov 2026 00:24:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C7021F00896; Mon, 30 Nov 2026 00:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795998281; bh=Ux/Wqe8UchsX/PhWcw7tdXZRndxMBKHrzh6LwRkGTaE=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=IQYF8ebjN9yYreC+6CLAs5hPXZ5618bRjrbp+/L0V6jBvTav4QSbJ9RotLtYh32vi dpFcamzKrBvAtKYl5DtMeu2PdgPm8qMhlBI7MhwwvbJoaYFg59qVWqFFoAOjTJx9rA xiTHz6GhjpF1IeHfYcZMNEY3+58Xp1dEpdWwVpsTaOeErX4gVYOgUN5iFftGtry6HM ML42UwwEuMeQ0y7zVEuqmBUqIihK1bkiwq2dgatijbiDdX9SDvddm3fruNqDSjOZZ2 klYrSyUUW2wZlgFPgucOsm1HbC11rdkExXzRgfL+zNRvGpNbQnrRwJ9yp1XJatbWrY x50gdWTYC6ECg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: generic/255: read(2) returning ENOMEM on 64k file systems Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?VGhlb2RvcmUgVHMnbw==?= , "Ext4 Developers List" , linux-mm@kvack.org, "Matthew Wilcox" In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 00:24:40 +0000 X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 5FACE18000C X-Stat-Signature: bp1ehhgqpt5zjakrjopnnd949x5h7rqy X-Spam-Status: No, score=-20.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1795998282-966674 X-HE-Meta: U2FsdGVkX1/nrvDxg/+okC+CrVSUXm2p4RDDxJ6RUrp36fTySrHeSTvD5R9F+79Vs+d5k1eC//Kil7nJrGSGM6lIZiKEmcK5uz+sWNZc0LG2pER2p0rk+w828ObWrMFmBnBQ+IoxA6OkeoE8Y7luosXQq5trhdW2UGQwpbp0WKBjIQYEyGlAL67lYUfsN3JCXq688JdJzd3xeEddKFoW08E1AhjUPC9QGpzmefP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N/dPLYTYwmY2k744futoRXqZJmAeujGLbNExn7uBk9pP1R+lpLlgmv+KJpDOnE1Ewv/sLsSWJVF1rEw/mdetCKq/6SN8+DIhuOkC1SXo8iEeMOTKmspxppK0RouDf8H2H8dREHxvVn2esyLiCQcQolAG6j1Xc4JlXwuQpxQmzNfUEXR4uMjlhOiMu7AcDAnh3d7rkIkfeeXoFzrHoHheopB4l5ybR5rShj3JcT5X3ptFnjdVmk8/E9lt+dVL2+GqWmHlEj1K7BJa3H27olrMVDtoXifa6oeNa4FfMcYsKp6kBeHO+rqLb21MaforKeEyWNUiVjUeZQdXWMVPEvxfDr6m3N0Ya2ycu8sdlvxkxSwCf98Xpgc4/vq6/m9TC+TKnMxY8aVl4YuWOg7HayhVxF3fpa0BHRXjrp9UjC6Omkd9iJQPzEzWzBy7QHr0jifocvR3qkHRyaRelyxVcgwjpdvFutUcdLn9qTjJOeZhS/5ylXeIor5fH7SYV07Yl7ZDAjoCcX+/J9ADRJ643YgtxsmR4ixeiEAc/iI5J/htkqGaltZ+2E9HYGkAn8bQ+RnI6SRQHCcjD+FlyMp8PV Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [High] mm: missing Signed-off-by trailer and informal RFC email commit message - [High] mm: vmscan: bypassing compaction_ready() breaks costly __GFP_RETRY_MAYFAIL - [Low] mm/filemap: missing Fixes trailer for minimum-order folio allocations -- commit 6134b8058c4679c6f6ebfa5d61c0da90b8cc6fdd Author: Theodore Ts'o > generic/255: read(2) returning ENOMEM on 64k file systems > > On systems with a 4k page size, when reading from a file system that > has a 64k block size, every page cache folio has an order of at least > 4, which is above PAGE_ALLOC_COSTLY_ORDER (=3D=3D 3). As a result, any > memory allocation without __GFP_RETRY_MAYFAIL or __GFP_NOFAIL can be > very prone to failure, even when there is gigabytes of memory > available. > > This is causing the xfstests test generic/251 to fail 50-60% of the > time on my test appliance when running the ext4/64k configuration. > It's not clear what the best solution might be. Please note that this > is not ext4 specific. Any file system attempting to use a 64k block > size on a system with 4k blocks could run into this issue. > > The simplest fix which the LLM came up with is the first attached > patch; it causes mm/filemap.c to use __GFP_RETRY_MAYFAIL when needed. > This is not a complete fix, however. The LLM came up with a more > reliable reproducer which fails nearly 100% of the time (25/26 runs), > using __GFP_RETRY_MAYFAIL beings it down to 4% of the time (1/23 > runs)[1]. > > [1] https://github.com/tytso/ext4-artifacts/blob/main/2026-11-xfstests-te= st-fixes/evidence/mm251/findings.md#42-test-results > > Using __GFP_NOFAIL makes it completely reliable (of course), as does > an additional patch which changes direct relcaim to be more aggressive > if __GFP_RETRY_MAYFAIL is passed (the second attached patch, > direct-reclaim.patch). > > I believe the first patch shouldn't be _too_ controversial; but it's > not a complete solution. Is the second patch is the right way to go, > or would some other approach would be better? > > Thanks in advance for suggestions and comments! > > - Ted > > P.S. For more details, you can read (in very exhausting detail) the > report from the LLM[2]. Other xfstests failures that I'm working > through can be found here[3]. > > [2] https://github.com/tytso/ext4-artifacts/blob/main/2026-11-xfstests-te= st-fixes/evidence/mm251/findings.md > [3] https://github.com/tytso/ext4-artifacts/blob/main/2026-11-xfstests-te= st-fixes/xfstests-fixes.md [Severity: High] This commit is missing a Signed-off-by: trailer. In addition, the commit message is written as an informal RFC mailing-list note discussing two separate attached patches rather than a self-contained kernel changelog, and the subject line lacks an mm: prefix while citing generic/255 instead of generic/251. [Severity: Low] For the minimum folio order allocation failure in mm/filemap.c, should this include a Fixes: tag for the commit that started allocating mapping_min_folio_order() folios? Fixes: ab95d23bab22 ("filemap: allocate mapping_min_order folios in the p= age cache") > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 6a1af9b92349f..66b8d1bcc0fd5 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -6680,6 +6680,7 @@ static void shrink_zones(struct zonelist *zonelist,= struct scan_control *sc) > */ > if (IS_ENABLED(CONFIG_COMPACTION) && > sc->order > PAGE_ALLOC_COSTLY_ORDER && > + !(sc->gfp_mask & __GFP_RETRY_MAYFAIL) && > compaction_ready(zone, sc)) { > sc->compaction_ready =3D true; > continue; [Severity: High] Does bypassing compaction_ready() for all costly __GFP_RETRY_MAYFAIL allocations force unconditional node reclaim and prevent compaction from escalating to COMPACT_PRIO_SYNC_FULL when a zone already has plenty of free base pages? In __alloc_pages_slowpath(), the initial compact_first pass only runs COMPACT_PRIO_ASYNC compaction before entering __alloc_pages_direct_reclaim(= ). compaction_ready() checks both whether the high-order watermark is already met and whether free base pages satisfy compaction_suitable() above the high watermark: mm/vmscan.c:compaction_ready() { if (!gfp_compaction_allowed(sc->gfp_mask)) return false; /* Allocation can already succeed, nothing to do */ if (zone_watermark_ok(zone, sc->order, min_wmark_pages(zone), sc->reclaim_idx, 0)) return true; ... watermark =3D high_wmark_pages(zone); if (compaction_suitable(zone, sc->order, watermark, sc->reclaim_idx)) return true; return false; } With compaction_ready() skipped, shrink_zones() unconditionally calls shrink_node() on every node in the zonelist even when gigabytes of free order-0..3 pages are already available for synchronous compaction. Under MGLRU, shrink_node() does not call should_continue_reclaim() and keeps reclaiming until sc->nr_reclaimed reaches max(sc->nr_to_reclaim, compact_gap(sc->order)). Worse, if a zone has abundant free base pages for compaction but no unprotected reclaimable LRU pages (for example, memory is already free in lower orders or protected by memory.low), sc->compaction_ready remains false and do_try_to_free_pages() cannot return 1 via its sc->compaction_ready check. Instead, direct reclaim scans all priorities down to 0, throttles in VMSCAN_THROTTLE_NOPROGRESS, triggers the force_deactivate and memcg_low_reclaim retry passes (breaching cgroup memory.low protection), and returns 0. A zero return from __perform_reclaim() causes __alloc_pages_direct_reclaim() to skip drain_all_pages() and causes __alloc_pages_slowpath() to skip should_compact_retry(), so compaction never escalates to COMPACT_PRIO_SYNC_FULL. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/awsvBJeU3SGSdklm@mi= t.edu?part=3D1