函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Bring missing pages in from swap, to complete THP collapse.* Only done if khugepaged_scan_pmd believes it is worthwhile.* Called and returns without pte mapped or spinlocks held,* but with mmap_sem held to protect against vma changes.

函数原型:static bool __collapse_huge_page_swapin(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pmd_t *pmd, int referenced)

返回类型:bool

参数:

类型参数名称
struct mm_struct *mm
struct vm_area_struct *vma
unsigned longaddress
pmd_t *pmd
intreferenced
895  swapped_in等于0
896  ret等于0
897  struct vm_fault vmf = {Target VMA = vma, Faulting virtual address = address, FAULT_FLAG_xxx flags = Retry fault if blocking , Pointer to pmd entry matching* the 'address' = pmd, Logical page offset based on vma = linear_page_index(vma, address), }
906  如果referenced小于HPAGE_PMD_NR除2则
907  trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0)
908  返回:false
910  Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.等于pte_offset_map(pmd, address)
911 Faulting virtual address 小于addressHPAGE_PMD_NRPAGE_SIZE循环
913  Value of PTE at the time of fault 等于Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.
914  如果非heck whether a pte points to a swap entry 则继续下一循环
916  swapped_in自加
917  ret等于We enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases
920  如果ret按位与VM_FAULT_RETRY
928  如果mm_find_pmd(mm, address)不等于pmd
933  如果ret按位与VM_FAULT_ERROR
935  返回:false
938  Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.等于pte_offset_map(pmd, Faulting virtual address )
940  Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.自减
941  pte_unmap(Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated.)
942  trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 1)
943  返回:true
调用者
名称描述
collapse_huge_page