diff mbox series

[v2,12/15] mm/memory: pass PTE to copy_present_pte()

Message ID 20240125193227.444072-13-david@redhat.com (mailing list archive)
State Superseded
Headers show
Series mm/memory: optimize fork() with PTE-mapped THP | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail merge-conflict
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-12-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-12-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-12-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-12-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-12-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-12-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-12-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-12-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-12-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-12-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-12-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-12-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

David Hildenbrand Jan. 25, 2024, 7:32 p.m. UTC
We already read it, let's just forward it.

This patch is based on work by Ryan Roberts.

Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 mm/memory.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/mm/memory.c b/mm/memory.c
index 10fc14ff8e49b..729ca4d6a820c 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -959,10 +959,9 @@  static inline void __copy_present_pte(struct vm_area_struct *dst_vma,
  */
 static inline int
 copy_present_pte(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
-		 pte_t *dst_pte, pte_t *src_pte, unsigned long addr, int *rss,
-		 struct folio **prealloc)
+		 pte_t *dst_pte, pte_t *src_pte, pte_t pte, unsigned long addr,
+		 int *rss, struct folio **prealloc)
 {
-	pte_t pte = ptep_get(src_pte);
 	struct page *page;
 	struct folio *folio;
 
@@ -1103,7 +1102,7 @@  copy_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
 		}
 		/* copy_present_pte() will clear `*prealloc' if consumed */
 		ret = copy_present_pte(dst_vma, src_vma, dst_pte, src_pte,
-				       addr, rss, &prealloc);
+				       ptent, addr, rss, &prealloc);
 		/*
 		 * If we need a pre-allocated page for this pte, drop the
 		 * locks, allocate, and try again.