Skip to content

Commit

Permalink
mm: use flush_icache_pages() in do_set_pmd()
Browse files Browse the repository at this point in the history
Push the iteration over each page down to the architectures (many can
flush the entire THP without iteration).

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Aug 12, 2023
1 parent 911dd1a commit 1af94df
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -4268,7 +4268,6 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page)
bool write = vmf->flags & FAULT_FLAG_WRITE;
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
pmd_t entry;
int i;
vm_fault_t ret = VM_FAULT_FALLBACK;

if (!transhuge_vma_suitable(vma, haddr))
Expand Down Expand Up @@ -4301,8 +4300,7 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page)
if (unlikely(!pmd_none(*vmf->pmd)))
goto out;

for (i = 0; i < HPAGE_PMD_NR; i++)
flush_icache_page(vma, page + i);
flush_icache_pages(vma, page, HPAGE_PMD_NR);

entry = mk_huge_pmd(page, vma->vm_page_prot);
if (write)
Expand Down

0 comments on commit 1af94df

Please sign in to comment.