函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-27 16:07:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:copy_page_range

函数原型:int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, struct vm_area_struct *vma)

返回类型:int

参数:

类型参数名称
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  如果非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 的值的值且非Serialized by page_table_lock 则返回:0
976  如果is_vm_hugetlb_page(vma)则返回:copy_hugetlb_page_range(dst_mm, src_mm, vma)
979  如果此条件成立可能性小(为编译器优化)(Flags, see mm.h. & Page-ranges managed without "struct page", just pure PFN )则
984  ret等于track_pfn_copy(vma)
985  如果ret则返回:ret
995  is_cow等于is_cow_mapping(Flags, see mm.h. )
997  如果is_cow
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  循环
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  如果pgd_none_or_clear_bad(src_pgd)则继续下一循环
1012  ret等于负ENOMEM
1013  退出
1015 dst_pgd自加, src_pgd自加, addr等于next, addr不等于end循环
1017  如果is_cowmmu_notifier_invalidate_range_end( & range)
1019  返回:ret
调用者
名称描述
dup_mmap