函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__unmap_hugepage_range

函数原型:void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page)

返回类型:void

参数:

类型参数名称
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 address小于end循环
3434  ptep等于huge_pte_offset(mm, address, sz)
3435  如果非ptep则继续下一循环
3438  ptl等于huge_pte_lock(h, mm, ptep)
3439  如果huge_pmd_unshare(mm, & address, ptep)则
3445  继续下一循环
3448  pte等于huge_ptep_get(ptep)
3449  如果huge_pte_none(pte)则
3451  继续下一循环
3461  继续下一循环
3464  page等于pte_page(pte)
3470  如果ref_page
3471  如果page不等于ref_page
3473  继续下一循环
3483  pte等于huge_ptep_get_and_clear(mm, address, ptep)
3484  tlb_remove_huge_tlb_entry(h, tlb, ptep, address)
3485  如果huge_pte_dirty(pte)则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  自旋锁解锁
3492  tlb_remove_page_size(tlb, page, huge_page_size(h))
3496  如果ref_page退出
3499  mmu_notifier_invalidate_range_end( & range)
3500  tlb_end_vma(tlb, vma)
调用者
名称描述
__unmap_hugepage_range_final
unmap_hugepage_range