summaryrefslogtreecommitdiff
path: root/mm/memory.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2023-08-02 18:14:01 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-08-25 02:20:25 +0300
commit9f1f5b60e76d44fa85fef6970b7477f72d3999eb (patch)
tree31c4dac4c4254c9cada0af19fe030edf507c017c /mm/memory.c
parentaf4fcb0729329cc4b3f6977d7f75562a00174bd1 (diff)
downloadlinux-9f1f5b60e76d44fa85fef6970b7477f72d3999eb.tar.xz
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>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 2c6f45d18b73..fbb7f066bfb6 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4265,7 +4265,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))
@@ -4298,8 +4297,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)