]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: preserve PG_dropbehind flag during folio split
authorJeff Layton <jlayton@kernel.org>
Mon, 11 May 2026 11:58:27 +0000 (07:58 -0400)
committerChristian Brauner <brauner@kernel.org>
Thu, 4 Jun 2026 08:16:50 +0000 (10:16 +0200)
__split_folio_to_order() copies page flags from the original folio to
newly created sub-folios using an explicit allowlist, but PG_dropbehind
is not included. When a large folio with PG_dropbehind set is split,
only the head sub-folio retains the flag; all tail sub-folios silently
lose it and will not be reclaimed eagerly after writeback completes.

Add PG_dropbehind to the flag copy mask so that the drop-behind hint
is preserved across folio splits.

Fixes: a323281cdfec ("mm: add PG_dropbehind folio flag")
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260511-dontcache-v7-1-2848ddce8090@kernel.org
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
mm/huge_memory.c

index 970e077019b75a4ad140c6ac16d993544fc85298..e01917b14d1ae692a5e2a408e6b21e9912693dba 100644 (file)
@@ -3642,6 +3642,7 @@ static void __split_folio_to_order(struct folio *folio, int old_order,
                                 (1L << PG_arch_3) |
 #endif
                                 (1L << PG_dirty) |
+                                (1L << PG_dropbehind) |
                                 LRU_GEN_MASK | LRU_REFS_MASK));
 
                if (handle_hwpoison &&