mm: Change copy_page_range() to take two vma arguments
Subsystems (5)
Commit-ID: 717a4cdb5f6b57e2b463c6fec63a1508d19d1f41 Gitweb: http://git.kernel.org/tip/717a4cdb5f6b57e2b463c6fec63a1508d19d1f41 Author: Peter Zijlstra <[email protected]> AuthorDate: Tue, 15 May 2012 23:49:53 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 18 May 2012 08:16:26 +0200
mm: Change copy_page_range() to take two vma arguments
Since copy_page_range() copies from one vma into another, pass it the two VMAs. This makes dst_vma available inside the callchain and allows for per vma rss accounting later on.
Signed-off-by Peter Zijlstra <[email protected]>
Cc Suresh Siddha <[email protected]>
Cc Paul Turner <[email protected]>
Cc Dan Smith <[email protected]>
Cc Bharata B Rao <[email protected]>
Cc Lee Schermerhorn <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- include/linux/huge_mm.h | 9 ++--- include/linux/mm.h | 3 +- kernel/fork.c | 2 +- mm/huge_memory.c | 8 ++-- mm/memory.c | 77 ++++++++++++++++++++++------------------------ 5 files changed, 47 insertions(+), 52 deletions(-)
include/linux/huge_mm.h +4 -5
@@ -5,9 +5,8 @@ extern int do_huge_pmd_anonymous_page(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, pmd_t *pmd, unsigned int flags); -extern int copy_huge_pmd (struct mm_struct *dst_mm,struct mm_struct *src_mm, -pmd_t *dst_pmd,pmd_t *src_pmd,unsigned long addr, -struct vm_area_struct *vma); +extern int copy_huge_pmd (struct vm_area_struct *dst_vma,struct vm_area_struct *src_vma, +pmd_t *dst_pmd,pmd_t *src_pmd,unsigned long addr);extern int do_huge_pmd_wp_page (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,pmd_t *pmd,pmd_t orig_pmd);
@@ -82,9 +81,9 @@ extern pmd_t *page_check_address_pmd(struct page *page,#endif /* CONFIG_DEBUG_VM */ extern unsigned long transparent_hugepage_flags; -extern int copy_pte_range (struct mm_struct *dst_mm,struct mm_struct *src_mm, +extern int copy_pte_range (struct vm_area_struct *dst_vma, +struct vm_area_struct *src_vma,pmd_t *dst_pmd,pmd_t *src_pmd, -struct vm_area_struct *vma,unsigned long addr,unsigned long end); extern int handle_pte_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address,
include/linux/mm.h +1 -2
@@ -933,8 +933,7 @@ int walk_page_range(unsigned long addr, unsigned long end, struct mm_walk *walk);void free_pgd_range (struct mmu_gather *tlb,unsigned long addr,unsigned long end,unsigned long floor,unsigned long ceiling); -int copy_page_range (struct mm_struct *dst,struct mm_struct *src, -struct vm_area_struct *vma); +int copy_page_range (struct vm_area_struct *dst_vma,struct vm_area_struct *src_vma);void unmap_mapping_range (struct address_space *mapping,loff_t const holebegin,loff_t const holelen,int even_cows); int follow_pfn(struct vm_area_struct *vma, unsigned long address,
kernel/fork.c +1 -1
@@ -440,7 +440,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) rb_parent = &tmp->vm_rb; mm->map_count++; - retval =copy_page_range (mm, oldmm, mpnt); + retval =copy_page_range (tmp, mpnt);if (tmp->vm_ops && tmp->vm_ops->open) tmp->vm_ops->open (tmp);
mm/huge_memory.c +4 -4
@@ -748,10 +748,10 @@ out:return handle_pte_fault (mm, vma, address, pte, pmd, flags); } -int copy_huge_pmd (struct mm_struct *dst_mm,struct mm_struct *src_mm, -pmd_t *dst_pmd,pmd_t *src_pmd,unsigned long addr, -struct vm_area_struct *vma) +int copy_huge_pmd (struct vm_area_struct *dst_vma,struct vm_area_struct *src_vma, +pmd_t *dst_pmd,pmd_t *src_pmd,unsigned long addr) { +struct mm_struct *dst_mm = dst_vma->vm_mm, *src_mm = src_vma->vm_mm;struct page *src_page;pmd_t pmd;pgtable_t pgtable;
@@ -777,7 +777,7 @@ int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,spin_unlock (&dst_mm->page_table_lock);pte_free (dst_mm, pgtable); -wait_split_huge_page (vma->anon_vma, src_pmd);/* src_vma */ +wait_split_huge_page (src_vma->anon_vma, src_pmd);/* src_vma */ goto out; } src_page =pmd_page (pmd);
mm/memory.c +37 -40
179 lines not on this page · raw message