mm: fix process_vm_rw page counts
[linux-2.6-microblaze.git] / mm / huge_memory.c
index 4f54244..6eb55f9 100644 (file)
@@ -2379,7 +2379,7 @@ void vma_adjust_trans_huge(struct vm_area_struct *vma,
 static void unmap_folio(struct folio *folio)
 {
        enum ttu_flags ttu_flags = TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD |
-               TTU_SYNC;
+               TTU_SYNC | TTU_BATCH_FLUSH;
 
        VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
 
@@ -2392,6 +2392,8 @@ static void unmap_folio(struct folio *folio)
                try_to_migrate(folio, ttu_flags);
        else
                try_to_unmap(folio, ttu_flags | TTU_IGNORE_MLOCK);
+
+       try_to_unmap_flush();
 }
 
 static void remap_page(struct folio *folio, unsigned long nr)