函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:NUMA hinting page fault entry point for trans huge pmds

函数原型:vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t pmd)

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
pmd_tpmd
1537  vma等于Target VMA
1538  struct anon_vma * anon_vma = NULL
1540  haddr等于Faulting virtual address 按位与HPAGE_PMD_MASK
1541  page_nid等于NUMA_NO_NODE, this_nid等于Returns the number of the current Node.
1542  last_cpupid等于负1
1544  bool migrated = false
1546  flags等于0
1548  Page table lock.* Protects pte page table if 'pte'* is not NULL, otherwise pmd.等于pmd_lock(The address space we belong to. , Pointer to pmd entry matching* the 'address' )
1549  如果此条件成立可能性小(为编译器优化)(!pmd_same(pmd, * Pointer to pmd entry matching* the 'address' ))则转到:out_unlock
1557  如果此条件成立可能性小(为编译器优化)(pmd_trans_migrating( * Pointer to pmd entry matching* the 'address' ))则
1558  page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:( * Pointer to pmd entry matching* the 'address' )
1559  如果非Try to grab a ref unless the page has a refcount of zero, return false if* that is the case.* This can be called when MMU is off so it must not access* any of the virtual mappings.则转到:out_unlock
1561  自旋锁解锁
1562  put_and_wait_on_page_locked - Drop a reference and wait for it to be unlocked*@page: The page to wait for
1563  转到:out
1566  page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(pmd)
1567  BUG_ON(is_huge_zero_page(page))
1568  page_nid等于page_to_nid(page)
1569  last_cpupid等于page_cpupid_last(page)
1570  count_vm_numa_event(NUMA_HINT_FAULTS)
1571  如果page_nid恒等于this_nid
1572  count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL)
1573  flags或等于TNF_FAULT_LOCAL
1577  如果非pmd_savedwrite(pmd)则flags或等于TNF_NO_GROUP
1584  page_locked等于Return true if the page was successfully locked
1585  target_nid等于mpol_misplaced - check whether current page node is valid in policy*@page: page to be checked*@vma: vm area where page mapped*@addr: virtual address where page mapped* Lookup current policy node id for vma,addr and "compare to" page's* node id
1586  如果target_nid恒等于NUMA_NO_NODE
1588  如果page_locked则转到:clear_pmdnuma
1593  如果非page_locked
1594  page_nid等于NUMA_NO_NODE
1595  如果非Try to grab a ref unless the page has a refcount of zero, return false if* that is the case.* This can be called when MMU is off so it must not access* any of the virtual mappings.则转到:out_unlock
1597  自旋锁解锁
1598  put_and_wait_on_page_locked - Drop a reference and wait for it to be unlocked*@page: The page to wait for
1599  转到:out
1606  get_page(page)
1607  自旋锁解锁
1608  anon_vma等于Similar to page_get_anon_vma() except it locks the anon_vma.* Its a little more complex as it tries to keep the fast path to a single* atomic op -- the trylock. If we fail the trylock, we fall back to getting a
1611  加自旋锁
1612  如果此条件成立可能性小(为编译器优化)(!pmd_same(pmd, * Pointer to pmd entry matching* the 'address' ))则
1613  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1614  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1615  page_nid等于NUMA_NO_NODE
1616  转到:out_unlock
1620  如果此条件成立可能性小(为编译器优化)(!anon_vma)则
1621  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1622  page_nid等于NUMA_NO_NODE
1623  转到:clear_pmdnuma
1637  如果mm_tlb_flush_pending(The address space we belong to. )则
1638  flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE)
1648  mmu_notifier_invalidate_range(The address space we belong to. , haddr, haddr + HPAGE_PMD_SIZE)
1656  自旋锁解锁
1658  migrated等于migrate_misplaced_transhuge_page(The address space we belong to. , vma, Pointer to pmd entry matching* the 'address' , pmd, Faulting virtual address , page, target_nid)
1660  如果migrated
1661  flags或等于TNF_MIGRATED
1662  page_nid等于target_nid
1663  否则flags或等于TNF_MIGRATE_FAIL
1666  转到:out
1667  clear_pmdnuma :
1668  BUG_ON(!PageLocked(page))
1669  was_writable等于pmd_savedwrite(pmd)
1670  pmd等于pmd_modify(pmd, Access permissions of this VMA. )
1671  pmd等于pmd_mkyoung(pmd)
1672  如果was_writablepmd等于pmd_mkwrite(pmd)
1674  set_pmd_at(The address space we belong to. , haddr, Pointer to pmd entry matching* the 'address' , pmd)
1675  update_mmu_cache_pmd(vma, Faulting virtual address , Pointer to pmd entry matching* the 'address' )
1676  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1677  out_unlock :
1678  自旋锁解锁
1680  out :
1681  如果anon_vmapage_unlock_anon_vma_read(anon_vma)
1684  如果page_nid不等于NUMA_NO_NODEtask_numa_fault(last_cpupid, page_nid, HPAGE_PMD_NR, flags)
1688  返回:0
调用者
名称描述
__handle_mm_faultBy the time we get here, we already hold the mm semaphore* The mmap_sem may have been released depending on flags and our* return value. See filemap_fault() and __lock_page_or_retry().