summaryrefslogtreecommitdiff
path: root/lib/test_hmm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test_hmm.c')
-rw-r--r--lib/test_hmm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index 46fa9e200db8..df429670633e 100644
--- a/lib/test_hmm.c
+++ b/lib/test_hmm.c
@@ -1613,6 +1613,15 @@ static vm_fault_t dmirror_devmem_fault(struct vm_fault *vmf)
nr = 1 << order;
/*
+ * When folios are partially mapped, we can't rely on the folio
+ * order of vmf->page as the folio might not be fully split yet
+ */
+ if (vmf->pte) {
+ order = 0;
+ nr = 1;
+ }
+
+ /*
* Consider a per-cpu cache of src and dst pfns, but with
* large number of cpus that might not scale well.
*/