All of lore.kernel.org
 help / color / mirror / Atom feed
* [folded-merged] selftests-mm-reimplement-is_backed_by_thp-with-more-precise-check-fix.patch removed from -mm tree
@ 2025-09-13 22:23 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-09-13 22:23 UTC (permalink / raw)
  To: mm-commits, david, ziy, akpm


The quilt patch titled
     Subject: fixup: selftests/mm: use nr_pages instead of 1UL << order
has been removed from the -mm tree.  Its filename was
     selftests-mm-reimplement-is_backed_by_thp-with-more-precise-check-fix.patch

This patch was dropped because it was folded into selftests-mm-reimplement-is_backed_by_thp-with-more-precise-check.patch

------------------------------------------------------
From: Zi Yan <ziy@nvidia.com>
Subject: fixup: selftests/mm: use nr_pages instead of 1UL << order
Date: Tue, 19 Aug 2025 12:52:13 -0400

reduce code duplication, per David

Link: https://lkml.kernel.org/r/F54782D6-65A3-4D35-AE03-8ADE636EE258@nvidia.com
Signed-off-by: Zi Yan <ziy@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 tools/testing/selftests/mm/split_huge_page_test.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/tools/testing/selftests/mm/split_huge_page_test.c~selftests-mm-reimplement-is_backed_by_thp-with-more-precise-check-fix
+++ a/tools/testing/selftests/mm/split_huge_page_test.c
@@ -38,6 +38,7 @@ unsigned int pmd_order;
 static bool is_backed_by_folio(char *vaddr, int order, int pagemap_fd,
 		int kpageflags_fd)
 {
+	const unsigned long nr_pages = 1UL << order;
 	unsigned long pfn_head;
 	uint64_t pfn_flags;
 	unsigned long pfn;
@@ -63,7 +64,7 @@ static bool is_backed_by_folio(char *vad
 	if (!(pfn_flags & KPF_THP))
 		return false;
 
-	pfn_head = pfn & ~((1 << order) - 1);
+	pfn_head = pfn & ~(nr_pages - 1);
 
 	if (pageflags_get(pfn_head, kpageflags_fd, &pfn_flags))
 		goto fail;
@@ -73,7 +74,7 @@ static bool is_backed_by_folio(char *vad
 		return false;
 
 	/* check all tail PFN flags */
-	for (i = 1; i < 1UL << order; i++) {
+	for (i = 1; i < nr_pages; i++) {
 		if (pageflags_get(pfn_head + i, kpageflags_fd, &pfn_flags))
 			goto fail;
 		if (!(pfn_flags & (KPF_THP | KPF_COMPOUND_TAIL)))
@@ -84,7 +85,7 @@ static bool is_backed_by_folio(char *vad
 	 * check the PFN after this folio, but if its flags cannot be obtained,
 	 * assume this folio has the expected order
 	 */
-	if (pageflags_get(pfn_head + (1UL << order), kpageflags_fd, &pfn_flags))
+	if (pageflags_get(pfn_head + nr_pages, kpageflags_fd, &pfn_flags))
 		return true;
 
 	/* this folio is bigger than the given order */
_

Patches currently in -mm which might be from ziy@nvidia.com are

mm-huge_memory-add-new_order-and-offset-to-split_huge_pages-pr_debug.patch
selftests-mm-mark-all-functions-static-in-split_huge_page_testc.patch
selftests-mm-reimplement-is_backed_by_thp-with-more-precise-check.patch
selftests-mm-add-check_after_split_folio_orders-helper.patch
selftests-mm-check-after-split-folio-orders-in-split_huge_page_test.patch


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

only message in thread, other threads:[~2025-09-13 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-13 22:23 [folded-merged] selftests-mm-reimplement-is_backed_by_thp-with-more-precise-check-fix.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.