函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:copy_pte_range

函数原型:static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, pmd_t *dst_pmd, pmd_t *src_pmd, struct vm_area_struct *vma, unsigned long addr, unsigned long end)

返回类型:int

参数:

类型参数名称
struct mm_struct *dst_mm
struct mm_struct *src_mm
pmd_t *dst_pmd
pmd_t *src_pmd
struct vm_area_struct *vma
unsigned longaddr
unsigned longend
809  progress等于0
811  swp_entry_t entry = (swp_entry_t){0}
813  again :
814  init_rss_vec(rss)
816  dst_pte等于pte_alloc_map_lock(dst_mm, dst_pmd, addr, & dst_ptl)
817  如果非dst_pte则返回:负ENOMEM
819  src_pte等于pte_offset_map(src_pmd, addr)
820  src_ptl等于pte_lockptr(src_mm, src_pmd)
821  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.))
822  orig_src_pte等于src_pte
823  orig_dst_pte等于dst_pte
824  A facility to provide lazy MMU batching()
826  循环
831  如果progress大于等于32则
832  progress等于0
837  如果pte_none( * src_pte)则
838  progress自加
839  继续下一循环
841  val等于py one vm_area from one task to the other. Assumes the page tables* already present in the new task to be cleared in the whole range* covered by this vma.
843  如果val退出
845  progress加等于8
846 dst_pte自加, src_pte自加, addr加等于PAGE_SIZE, addr不等于end循环
848  arch_leave_lazy_mmu_mode()
849  自旋锁解锁
850  pte_unmap(orig_src_pte)
851  add_mm_rss_vec(dst_mm, rss)
852  pte_unmap_unlock(orig_dst_pte, dst_ptl)
853  cond_resched()
855  如果val
856  如果add_swap_count_continuation(entry, GFP_KERNEL)小于0则返回:负ENOMEM
858  progress等于0
860  如果addr不等于end则转到:again
862  返回:0
调用者
名称描述
copy_pmd_range