diff --git a/mm/migrate.c b/mm/migrate.c index 996c0e386734..54b168a3b84a 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -916,12 +916,8 @@ static int move_to_new_page(struct page *newpage, struct page *page, if (!PageMappingFlags(page)) page->mapping = NULL; - if (likely(!is_zone_device_page(newpage))) { - int i, nr = compound_nr(newpage); - - for (i = 0; i < nr; i++) - flush_dcache_page(newpage + i); - } + if (likely(!is_zone_device_page(newpage))) + flush_dcache_folio(page_folio(newpage)); } out: return rc;