The patch titled Subject: mm-remove-src-dst-mm-parameter-in-copy_page_range-v2-fix has been removed from the -mm tree. Its filename was mm-remove-src-dst-mm-parameter-in-copy_page_range-v2-fix.patch This patch was dropped because it was folded into mm-remove-src-dst-mm-parameter-in-copy_page_range.patch ------------------------------------------------------ From: Peter Xu <peterx@xxxxxxxxxx> Subject: mm-remove-src-dst-mm-parameter-in-copy_page_range-v2-fix The required change attached; this is quite special that we only referenced the mm once in each of the function, so that temp variable can actually be avoided. Ideally there should be some way to only define the variable on archs that need this mm pointer (e.g., when set_pte_at() or some similar function is called multiple times in some function, it should still be helpful to introduce a local variable to keep dst_vma->vm_mm). However I don't know a good way to do this... Link: https://lkml.kernel.org/r/20201006200138.GA6026@xz-x1 Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/mm/memory.c~mm-remove-src-dst-mm-parameter-in-copy_page_range-v2-fix +++ a/mm/memory.c @@ -798,7 +798,6 @@ copy_present_page(struct vm_area_struct pte_t *dst_pte, pte_t *src_pte, unsigned long addr, int *rss, struct page **prealloc, pte_t pte, struct page *page) { - struct mm_struct *dst_mm = dst_vma->vm_mm; struct mm_struct *src_mm = src_vma->vm_mm; struct page *new_page; @@ -874,7 +873,7 @@ copy_present_page(struct vm_area_struct /* All done, just insert the new page copy in the child */ pte = mk_pte(new_page, dst_vma->vm_page_prot); pte = maybe_mkwrite(pte_mkdirty(pte), dst_vma); - set_pte_at(dst_mm, addr, dst_pte, pte); + set_pte_at(dst_vma->vm_mm, addr, dst_pte, pte); return 0; } @@ -887,7 +886,6 @@ copy_present_pte(struct vm_area_struct * pte_t *dst_pte, pte_t *src_pte, unsigned long addr, int *rss, struct page **prealloc) { - struct mm_struct *dst_mm = dst_vma->vm_mm; struct mm_struct *src_mm = src_vma->vm_mm; unsigned long vm_flags = src_vma->vm_flags; pte_t pte = *src_pte; @@ -932,7 +930,7 @@ copy_present_pte(struct vm_area_struct * if (!(vm_flags & VM_UFFD_WP)) pte = pte_clear_uffd_wp(pte); - set_pte_at(dst_mm, addr, dst_pte, pte); + set_pte_at(dst_vma->vm_mm, addr, dst_pte, pte); return 0; } _ Patches currently in -mm which might be from peterx@xxxxxxxxxx are mm-remove-src-dst-mm-parameter-in-copy_page_range.patch