From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, akpm@linux-foundation.org
Cc: David Hildenbrand <david@kernel.org>
Subject: [merged] mm-khugepaged-dont-map-folios-that-are-not-uptodate-in-madv_collapse.patch removed from -mm tree
Date: Sat, 07 Nov 2026 11:39:56 -0800 [thread overview]
Message-ID: <20261107193956.C154C1F0089F@smtp.kernel.org> (raw)
The quilt patch titled
Subject: mm/khugepaged: don't map folios that are not uptodate in MADV_COLLAPSE
has been removed from the -mm tree. Its filename was
mm-khugepaged-dont-map-folios-that-are-not-uptodate-in-madv_collapse.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: "David Hildenbrand (Arm)" <david@kernel.org>
Subject: mm/khugepaged: don't map folios that are not uptodate in MADV_COLLAPSE
Date: Thu, 05 Nov 2026 19:16:44 +0100
madvise(MADV_COLLAPSE) can map PMD-sized pagecache folios that are not
uptodate. For example, shmem fallocate() can put such folios into the
page cache.
collapse_file() already refuses to proceed with folios that are not
uptodate. Let's just do the same in try_collapse_pte_mapped_thp() and
skip such folios, leaving handling to the page faults.
Note that collapse_file() effectively clears shmem folios through
shmem_get_folio(); let's keep this fix simple and simply let the page
fault path deal with that.
Link: https://lore.kernel.org/20261105-set_huge_pmd_uptodate-v1-1-a78d8a1b7117@kernel.org
Fixes: 34488399fa08 ("mm/madvise: add file and shmem support to MADV_COLLAPSE")
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Chris Mason <mason@kernel.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Zach O'Keefe <zokeefe@google.com>
Reviewed-by: SJ Park <sj@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Nico Pache <nico.pache@linux.dev>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Usama Arif <usama.arif@linux.dev>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: <stable@vger.kernel.org>
---
mm/khugepaged.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/mm/khugepaged.c~mm-khugepaged-dont-map-folios-that-are-not-uptodate-in-madv_collapse
+++ a/mm/khugepaged.c
@@ -1888,6 +1888,12 @@ static enum scan_result try_collapse_pte
goto drop_folio;
}
+ /* Leave any uninitialized folios to the page fault path. */
+ if (!folio_test_uptodate(folio)) {
+ result = SCAN_FAIL;
+ goto drop_folio;
+ }
+
result = find_pmd_or_thp_or_none(mm, haddr, &pmd);
switch (result) {
case SCAN_SUCCEED:
_
Patches currently in -mm which might be from david@kernel.org are
mm-memory-failure-fix-folio-refcount-leak-and-min_order_for_split-locking.patch
reply other threads:[~2026-11-07 19:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261107193956.C154C1F0089F@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=mm-commits@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.