函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:copy_hugetlb_page_range

函数原型:int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma)

返回类型:int

参数:

类型参数名称
struct mm_struct *dst
struct mm_struct *src
struct vm_area_struct *vma
3307  h等于hstate_vma(vma)
3308  sz等于huge_page_size(h)
3310  ret等于0
3312  cow等于Flags, see mm.h. 按位与VM_SHARED按位或VM_MAYWRITE的值的值恒等于VM_MAYWRITE
3314  如果cow
3315  mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, src, Our start address within vm_mm. , The first byte after our end addresswithin vm_mm. )
3318  mmu_notifier_invalidate_range_start( & range)
3321 addr小于The first byte after our end addresswithin vm_mm. 循环
3323  src_pte等于huge_pte_offset(src, addr, sz)
3324  如果非src_pte则继续下一循环
3326  dst_pte等于arch callbacks
3327  如果非dst_pte
3328  ret等于负ENOMEM
3329  退出
3341  dst_entry等于huge_ptep_get(dst_pte)
3342  如果dst_pte恒等于src_pte或非huge_pte_none(dst_entry)则继续下一循环
3345  dst_ptl等于huge_pte_lock(h, dst, dst_pte)
3346  src_ptl等于huge_pte_lockptr(h, src, src_pte)
3347  spin_lock_nested(src_ptl, For trivial one-depth nesting of a lock-class, the following* global define can be used. (Subsystems with multiple levels* of nesting should define their own lock-nesting subclasses.))
3348  entry等于huge_ptep_get(src_pte)
3349  dst_entry等于huge_ptep_get(dst_pte)
3350  如果huge_pte_none(entry)或非huge_pte_none(dst_entry)则否则如果此条件成立可能性小(为编译器优化)(is_hugetlb_entry_migration(entry) || is_hugetlb_entry_hwpoisoned(entry))则
3359  swp_entry等于Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t.
3371  set_huge_swap_pte_at(dst, addr, dst_pte, entry, sz)
3372  否则
3373  如果cow
3383  entry等于huge_ptep_get(src_pte)
3384  ptepage等于pte_page(entry)
3385  get_page(ptepage)
3386  page_dup_rmap(ptepage, true)
3387  set_huge_pte_at(dst, addr, dst_pte, entry)
3388  hugetlb_count_add(pages_per_huge_page(h), dst)
3390  自旋锁解锁
3391  自旋锁解锁
3394  如果cowmmu_notifier_invalidate_range_end( & range)
3397  返回:ret
调用者
名称描述
copy_page_range