Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__unmap_hugepage_range

Proto:void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page)

Type:void

Parameter:

TypeParameterName
struct mmu_gather *tlb
struct vm_area_struct *vma
unsigned longstart
unsigned longend
struct page *ref_page
3404  mm = The address space we belong to.
3410  h = hstate_vma(vma)
3411  sz = huge_page_size(h)
3414  WARN_ON(!is_vm_hugetlb_page(vma))
3415  BUG_ON(start & ~huge_page_mask(h))
3416  BUG_ON(end & ~huge_page_mask(h))
3422  tlb_change_page_size(tlb, sz)
3423  tlb_start_vma(tlb, vma)
3428  mmu_notifier_range_init( & range, MMU_NOTIFY_UNMAP, 0, vma, mm, start, end)
3430  adjust_range_if_pmd_sharing_possible(vma, & start, & end)
3431  mmu_notifier_invalidate_range_start( & range)
3432  address = start
3433  When address < end cycle
3434  ptep = huge_pte_offset(mm, address, sz)
3435  If Not ptep Then Continue
3438  ptl = huge_pte_lock(h, mm, ptep)
3439  If huge_pmd_unshare(mm, & address, ptep) Then
3440  spin_unlock(ptl)
3445  Continue
3448  pte = huge_ptep_get(ptep)
3449  If huge_pte_none(pte) Then
3450  spin_unlock(ptl)
3451  Continue
3460  spin_unlock(ptl)
3461  Continue
3464  page = pte_page(pte)
3470  If ref_page Then
3471  If page != ref_page Then
3472  spin_unlock(ptl)
3473  Continue
3483  pte = huge_ptep_get_and_clear(mm, address, ptep)
3484  tlb_remove_huge_tlb_entry(h, tlb, ptep, address)
3485  If huge_pte_dirty(pte) Then Dirty a page
3488  hugetlb_count_sub(pages_per_huge_page(h), mm)
3489  page_remove_rmap - take down pte mapping from a page*@page: page to remove mapping from*@compound: uncharge the page as compound or small page* The caller needs to hold the pte lock.
3491  spin_unlock(ptl)
3492  tlb_remove_page_size(tlb, page, huge_page_size(h))
3496  If ref_page Then Break
3499  mmu_notifier_invalidate_range_end( & range)
3500  tlb_end_vma(tlb, vma)
Caller
NameDescribe
__unmap_hugepage_range_final
unmap_hugepage_range