Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:copy_pte_range

Proto: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)

Type:int

Parameter:

TypeParameterName
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  If Not dst_pte Then Return -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  Do
831  If progress >= 32 Then
832  progress = 0
837  If pte_none( * src_pte) Then
838  progress++
839  Continue
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  If val Then Break
845  progress += 8
846  When dst_pte++, src_pte++, addr += PAGE_SIZE , addr != end cycle
848  arch_leave_lazy_mmu_mode()
849  spin_unlock(src_ptl)
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  If val Then
856  If add_swap_count_continuation(entry, GFP_KERNEL) < 0 Then Return -ENOMEM
858  progress = 0
860  If addr != end Then Go to again
862  Return 0
Caller
NameDescribe
copy_pmd_range