Skip to content

Commit

Permalink
mm: replace multiple dcache flush with flush_dcache_folio()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Muchun Song authored and torvalds committed Mar 22, 2022
1 parent 7c25a0b commit 3150be8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3150be8

Please sign in to comment.