函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:move_page_tables

函数原型:unsigned long move_page_tables(struct vm_area_struct *vma, unsigned long old_addr, struct vm_area_struct *new_vma, unsigned long new_addr, unsigned long len, bool need_rmap_locks)

返回类型:unsigned long

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longold_addr
struct vm_area_struct *new_vma
unsigned longnew_addr
unsigned longlen
boolneed_rmap_locks
249  old_end等于old_addrlen
250  flush_cache_range(vma, old_addr, old_end)
252  mmu_notifier_range_init( & range, MMU_NOTIFY_UNMAP, 0, vma, The address space we belong to. , old_addr, old_end)
254  mmu_notifier_invalidate_range_start( & range)
256 old_addr小于old_end循环
257  cond_resched()
258  next等于old_addrPMD_SIZE按位与PMD_MASK
260  extent等于nextold_addr
261  如果extent大于old_endold_addrextent等于old_endold_addr
263  old_pmd等于get_old_pmd(The address space we belong to. , old_addr)
264  如果非old_pmd则继续下一循环
266  new_pmd等于alloc_new_pmd(The address space we belong to. , vma, new_addr)
267  如果非new_pmd退出
269  如果is_swap_pmd( * old_pmd)或pmd_trans_huge( * old_pmd)则
270  如果extent恒等于HPAGE_PMD_SIZE
279  如果moved则继续下一循环
285  否则如果extent恒等于PMD_SIZE则如果pte_alloc(The address space we belong to. , new_pmd)则
305  退出
306  next等于new_addrPMD_SIZE按位与PMD_MASK
307  如果extent大于nextnew_addrextent等于nextnew_addr
309  move_ptes(vma, old_pmd, old_addr, old_addr + extent, new_vma, new_pmd, new_addr, need_rmap_locks)
313  mmu_notifier_invalidate_range_end( & range)
315  返回:lenold_addrold_end
调用者
名称描述
move_vma
shift_arg_pagesDuring bprm_mm_init(), we create a temporary stack at STACK_TOP_MAX. Once* the binfmt code determines where the new stack should reside, we shift it to* its final location. The process proceeds as follows:* 1) Use shift to calculate the new vma endpoints.