Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:move_ptes

Proto:static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, unsigned long old_addr, unsigned long old_end, struct vm_area_struct *new_vma, pmd_t *new_pmd, unsigned long new_addr, bool need_rmap_locks)

Type:void

Parameter:

TypeParameterName
struct vm_area_struct *vma
pmd_t *old_pmd
unsigned longold_addr
unsigned longold_end
struct vm_area_struct *new_vma
pmd_t *new_pmd
unsigned longnew_addr
boolneed_rmap_locks
120  mm = The address space we belong to.
123  bool force_flush = false
124  len = old_end - old_addr
144  If need_rmap_locks Then take_rmap_locks(vma)
151  old_pte = pte_offset_map_lock(mm, old_pmd, old_addr, & old_ptl)
152  new_pte = pte_offset_map(new_pmd, new_addr)
153  new_ptl = pte_lockptr(mm, new_pmd)
154  If new_ptl != old_ptl Then spin_lock_nested(new_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.))
156  flush_tlb_batched_pending(The address space we belong to. )
157  A facility to provide lazy MMU batching()
159  When old_addr < old_end cycle
161  If pte_none( * old_pte) Then Continue
164  pte = ptep_get_and_clear(mm, old_addr, old_pte)
176  If pte_present(pte) Then force_flush = true
178  pte = move_pte(pte, Access permissions of this VMA. , old_addr, new_addr)
179  pte = move_soft_dirty_pte(pte)
180  set_pte_at(mm, new_addr, new_pte, pte)
183  arch_leave_lazy_mmu_mode()
184  If force_flush Then flush_tlb_range(vma, old_end - len, old_end)
186  If new_ptl != old_ptl Then spin_unlock(new_ptl)
188  pte_unmap(new_pte - 1)
189  pte_unmap_unlock(old_pte - 1, old_ptl)
190  If need_rmap_locks Then drop_rmap_locks(vma)
Caller
NameDescribe
move_page_tables