Skip to content

Commit 9f1f5b6

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
mm: use flush_icache_pages() in do_set_pmd()
Push the iteration over each page down to the architectures (many can flush the entire THP without iteration). Link: https://lkml.kernel.org/r/20230802151406.3735276-34-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent af4fcb0 commit 9f1f5b6

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

mm/memory.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4265,7 +4265,6 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page)
42654265
bool write = vmf->flags & FAULT_FLAG_WRITE;
42664266
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
42674267
pmd_t entry;
4268-
int i;
42694268
vm_fault_t ret = VM_FAULT_FALLBACK;
42704269

42714270
if (!transhuge_vma_suitable(vma, haddr))
@@ -4298,8 +4297,7 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page)
42984297
if (unlikely(!pmd_none(*vmf->pmd)))
42994298
goto out;
43004299

4301-
for (i = 0; i < HPAGE_PMD_NR; i++)
4302-
flush_icache_page(vma, page + i);
4300+
flush_icache_pages(vma, page, HPAGE_PMD_NR);
43034301

43044302
entry = mk_huge_pmd(page, vma->vm_page_prot);
43054303
if (write)

0 commit comments

Comments
 (0)