Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:move_page_tables

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

Type:unsigned long

Parameter:

TypeParameterName
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_addr + len
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  When old_addr < old_end cycle
257  cond_resched()
258  next = old_addr + PMD_SIZE & PMD_MASK
260  extent = next - old_addr
261  If extent > old_end - old_addr Then extent = old_end - old_addr
263  old_pmd = get_old_pmd(The address space we belong to. , old_addr)
264  If Not old_pmd Then Continue
266  new_pmd = alloc_new_pmd(The address space we belong to. , vma, new_addr)
267  If Not new_pmd Then Break
269  If is_swap_pmd( * old_pmd) || pmd_trans_huge( * old_pmd) Then
270  If extent == HPAGE_PMD_SIZE Then
285  Else if extent == PMD_SIZE Then If pte_alloc(The address space we belong to. , new_pmd) Then
305  Break
306  next = new_addr + PMD_SIZE & PMD_MASK
307  If extent > next - new_addr Then extent = next - new_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  Return len + old_addr - old_end
Caller
NameDescribe
move_vma