arm64: efi: Execute runtime services from a dedicated stack
[platform/kernel/linux-starfive.git] / mm / migrate_device.c
index 6fa682e..721b236 100644 (file)
@@ -357,7 +357,8 @@ static bool migrate_vma_check_page(struct page *page, struct page *fault_page)
 }
 
 /*
- * Unmaps pages for migration. Returns number of unmapped pages.
+ * Unmaps pages for migration. Returns number of source pfns marked as
+ * migrating.
  */
 static unsigned long migrate_device_unmap(unsigned long *src_pfns,
                                          unsigned long npages,
@@ -373,8 +374,11 @@ static unsigned long migrate_device_unmap(unsigned long *src_pfns,
                struct page *page = migrate_pfn_to_page(src_pfns[i]);
                struct folio *folio;
 
-               if (!page)
+               if (!page) {
+                       if (src_pfns[i] & MIGRATE_PFN_MIGRATE)
+                               unmapped++;
                        continue;
+               }
 
                /* ZONE_DEVICE pages are not on LRU */
                if (!is_zone_device_page(page)) {