* [to-be-updated] selftests-mm-hmm-tests-test-pagemap-reads-of-pmd-device-private-entries.patch removed from -mm tree
@ 2026-06-04 19:20 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-06-04 19:20 UTC (permalink / raw)
To: mm-commits, dev.jain, akpm
The quilt patch titled
Subject: selftests/mm/hmm-tests: test pagemap reads of PMD device-private entries
has been removed from the -mm tree. Its filename was
selftests-mm-hmm-tests-test-pagemap-reads-of-pmd-device-private-entries.patch
This patch was dropped because an updated version will be issued
------------------------------------------------------
From: Dev Jain <dev.jain@arm.com>
Subject: selftests/mm/hmm-tests: test pagemap reads of PMD device-private entries
Date: Sat, 30 May 2026 08:54:12 +0000
To cover pagemap paths scanning PMD entries, add assertions to check
whether a device-private PMD entry has the correct pagemap information -
the PM_SWAP bit must be on in the pagemap entry. Before that, we must
assert through HMM_DMIRROR_SNAPSHOT snapshot that the leaf entry is at PMD
level and not PTE level.
Link: https://lore.kernel.org/20260530085413.1270139-3-dev.jain@arm.com
Signed-off-by: Dev Jain <dev.jain@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Balbir Singh <balbirs@nvidia.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Oscar Salvador (SUSE) <osalvador@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/mm/hmm-tests.c | 29 +++++++++++++++++++++++
1 file changed, 29 insertions(+)
--- a/tools/testing/selftests/mm/hmm-tests.c~selftests-mm-hmm-tests-test-pagemap-reads-of-pmd-device-private-entries
+++ a/tools/testing/selftests/mm/hmm-tests.c
@@ -2274,8 +2274,11 @@ TEST_F(hmm, migrate_anon_huge_fault)
unsigned long npages;
unsigned long size;
unsigned long i;
+ unsigned char *m;
+ uint64_t entry;
void *old_ptr;
void *map;
+ int pagemap_fd;
int *ptr;
int ret;
@@ -2316,6 +2319,32 @@ TEST_F(hmm, migrate_anon_huge_fault)
for (i = 0, ptr = buffer->mirror; i < size / sizeof(*ptr); ++i)
ASSERT_EQ(ptr[i], i);
+ if (!hmm_is_coherent_type(variant->device_number)) {
+ ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_SNAPSHOT,
+ buffer, npages);
+ ASSERT_EQ(ret, 0);
+ ASSERT_EQ(buffer->cpages, npages);
+
+ m = buffer->mirror;
+ for (i = 0; i < npages; ++i)
+ ASSERT_EQ(m[i], HMM_DMIRROR_PROT_DEV_PRIVATE_LOCAL |
+ HMM_DMIRROR_PROT_WRITE |
+ HMM_DMIRROR_PROT_PMD);
+
+ pagemap_fd = open("/proc/self/pagemap", O_RDONLY);
+ ASSERT_GE(pagemap_fd, 0);
+
+ for (i = 0; i < npages; ++i) {
+ entry = pagemap_get_entry(pagemap_fd,
+ (char *)buffer->ptr + i * self->page_size);
+
+ ASSERT_NE(entry & PM_SWAP, 0);
+ ASSERT_EQ(entry & PM_PRESENT, 0);
+ }
+
+ close(pagemap_fd);
+ }
+
/* Fault pages back to system memory and check them. */
for (i = 0, ptr = buffer->ptr; i < size / sizeof(*ptr); ++i)
ASSERT_EQ(ptr[i], i);
_
Patches currently in -mm which might be from dev.jain@arm.com are
mm-khugepaged-generalize-alloc_charge_folio.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-04 19:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04 19:20 [to-be-updated] selftests-mm-hmm-tests-test-pagemap-reads-of-pmd-device-private-entries.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.