aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuchun Song <[email protected]>2022-03-22 14:42:11 -0700
committerLinus Torvalds <[email protected]>2022-03-22 15:57:04 -0700
commit3150be8fa89e4d1064d250bb3f8ea3665d1ec5e9 (patch)
tree4584667d217e2dcda182d67311307a3a1e28dfec
parent7c25a0b89a487878b0691e6524fb5a8827322194 (diff)
mm: replace multiple dcache flush with flush_dcache_folio()
Simplify the code by using flush_dcache_folio(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Muchun Song <[email protected]> Reviewed-by: Mike Kravetz <[email protected]> Cc: Axel Rasmussen <[email protected]> Cc: David Rientjes <[email protected]> Cc: Fam Zheng <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Lars Persson <[email protected]> Cc: Peter Xu <[email protected]> Cc: Xiongchun Duan <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/migrate.c8
1 files changed, 2 insertions, 6 deletions
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;