Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-28 14:40:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:copy_page_range

Proto:int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, struct vm_area_struct *vma)

Type:int

Parameter:

TypeParameterName
struct mm_struct *dst_mm
struct mm_struct *src_mm
struct vm_area_struct *vma
960  addr = Our start address within vm_mm.
961  end = The first byte after our end addresswithin vm_mm.
972  If Not (Flags, see mm.h. & ( Huge TLB Page VM | Page-ranges managed without "struct page", just pure PFN | Can contain "struct page" and pure PFN pages )) && Not Serialized by page_table_lock Then Return 0
976  If is_vm_hugetlb_page(vma) Then Return copy_hugetlb_page_range(dst_mm, src_mm, vma)
979  If Value for the false possibility is greater at compile time(Flags, see mm.h. & Page-ranges managed without "struct page", just pure PFN ) Then
984  ret = track_pfn_copy(vma)
985  If ret Then Return ret
995  is_cow = is_cow_mapping(Flags, see mm.h. )
997  If is_cow Then
998  mmu_notifier_range_init( & range, MMU_NOTIFY_PROTECTION_PAGE, 0, vma, src_mm, addr, end)
1000  mmu_notifier_invalidate_range_start( & range)
1003  ret = 0
1004  dst_pgd = a shortcut to get a pgd_t in a given mm(dst_mm, addr)
1005  src_pgd = a shortcut to get a pgd_t in a given mm(src_mm, addr)
1006  Do
1007  next = When walking page tables, get the address of the next boundary,* or the end address of the range if that comes earlier. Although no* vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.(addr, end)
1008  If pgd_none_or_clear_bad(src_pgd) Then Continue
1012  ret = -ENOMEM
1013  Break
1015  When dst_pgd++, src_pgd++, addr = next , addr != end cycle
1017  If is_cow Then mmu_notifier_invalidate_range_end( & range)
1019  Return ret