Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:move_huge_pmd

Proto:bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr, unsigned long new_addr, unsigned long old_end, pmd_t *old_pmd, pmd_t *new_pmd)

Type:bool

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longold_addr
unsigned longnew_addr
unsigned longold_end
pmd_t *old_pmd
pmd_t *new_pmd
1871  mm = The address space we belong to.
1872  bool force_flush = false
1874  If old_addr & ~HPAGE_PMD_MASK || new_addr & ~HPAGE_PMD_MASK || old_end - old_addr < HPAGE_PMD_SIZE Then Return false
1883  If WARN_ON(!pmd_none( * new_pmd)) Then
1884  VM_BUG_ON(pmd_trans_huge( * new_pmd))
1885  Return false
1892  old_ptl = Returns page table lock pointer if a given pmd maps a thp, NULL otherwise.* Note that if it returns page table lock pointer, this routine returns without* unlocking page table lock. So callers must unlock it.
1893  If old_ptl Then
1894  new_ptl = pmd_lockptr(mm, new_pmd)
1895  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.))
1897  pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd)
1898  If pmd_present(pmd) Then force_flush = true
1900  VM_BUG_ON(!pmd_none( * new_pmd))
1907  pmd = move_soft_dirty_pmd(pmd)
1908  set_pmd_at(mm, new_addr, new_pmd, pmd)
1909  If force_flush Then flush_tlb_range(vma, old_addr, old_addr + PMD_SIZE)
1911  If new_ptl != old_ptl Then spin_unlock(new_ptl)
1913  spin_unlock(old_ptl)
1914  Return true
1916  Return false