All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] mm-huge_memory-simplify-page-tracking-in-remap_page-during-folio-split.patch removed from -mm tree
@ 2025-12-23  2:39 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-12-23  2:39 UTC (permalink / raw)
  To: mm-commits, ziy, richard.weiyang, akpm


The quilt patch titled
     Subject: mm/huge_memory: simplify page tracking in remap_page() during folio split
has been removed from the -mm tree.  Its filename was
     mm-huge_memory-simplify-page-tracking-in-remap_page-during-folio-split.patch

This patch was dropped because an updated version will be issued

------------------------------------------------------
From: Wei Yang <richard.weiyang@gmail.com>
Subject: mm/huge_memory: simplify page tracking in remap_page() during folio split
Date: Mon, 22 Dec 2025 13:45:31 +0000

After splitting a large folio, the resulting anonymous folios must be
remapped.

Currently, the code tracks progress by recording the number of processed
pages in an index variable (e.g., @i) and comparing it against the
total. This commit simplifies the logic by directly subtracting the
processed pages from the remaining count. This approach is more
straightforward and reduces the number of local variables.

Additionally, this commit renames the variable nr to nr_pages to improve
code readability and self-documentation.

Link: https://lkml.kernel.org/r/20251222134531.20968-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/huge_memory.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- a/mm/huge_memory.c~mm-huge_memory-simplify-page-tracking-in-remap_page-during-folio-split
+++ a/mm/huge_memory.c
@@ -3423,17 +3423,15 @@ bool unmap_huge_pmd_locked(struct vm_are
 	return __discard_anon_folio_pmd_locked(vma, addr, pmdp, folio);
 }
 
-static void remap_page(struct folio *folio, unsigned long nr, int flags)
+static void remap_page(struct folio *folio, unsigned long nr_pages, int flags)
 {
-	int i = 0;
-
 	/* If unmap_folio() uses try_to_migrate() on file, remove this check */
 	if (!folio_test_anon(folio))
 		return;
 	for (;;) {
 		remove_migration_ptes(folio, folio, RMP_LOCKED | flags);
-		i += folio_nr_pages(folio);
-		if (i >= nr)
+		nr_pages -= folio_nr_pages(folio);
+		if (!nr_pages)
 			break;
 		folio = folio_next(folio);
 	}
_

Patches currently in -mm which might be from richard.weiyang@gmail.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-23  2:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-23  2:39 [to-be-updated] mm-huge_memory-simplify-page-tracking-in-remap_page-during-folio-split.patch removed from -mm tree Andrew Morton

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.