函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:move_ptes

函数原型: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)

返回类型:void

参数:

类型参数名称
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_endold_addr
144  如果need_rmap_lockstake_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  如果new_ptl不等于old_ptlspin_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 old_addr小于old_end循环
161  如果pte_none( * old_pte)则继续下一循环
164  pte等于ptep_get_and_clear(mm, old_addr, old_pte)
176  如果pte_present(pte)则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  如果force_flushflush_tlb_range(vma, old_end - len, old_end)
186  如果new_ptl不等于old_ptl自旋锁解锁
188  pte_unmap(new_pte - 1)
189  pte_unmap_unlock(old_pte - 1, old_ptl)
190  如果need_rmap_locksdrop_rmap_locks(vma)
调用者
名称描述
move_page_tables