函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__do_huge_pmd_anonymous_page

函数原型:static vm_fault_t __do_huge_pmd_anonymous_page(struct vm_fault *vmf, struct page *page, gfp_t gfp)

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
struct page *page
gfp_tgfp
578  vma等于Target VMA
581  haddr等于Faulting virtual address 按位与HPAGE_PMD_MASK
582  ret等于0
584  VM_BUG_ON_PAGE(!PageCompound(page), page)
586  如果mem_cgroup_try_charge_delay(page, The address space we belong to. , gfp, & memcg, true)则
587  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
588  Disable counters
589  返回:VM_FAULT_FALLBACK
592  pgtable等于pte_alloc_one(The address space we belong to. )
593  如果此条件成立可能性小(为编译器优化)(!pgtable)则
594  ret等于VM_FAULT_OOM
595  转到:release
598  clear_huge_page(page, Faulting virtual address , HPAGE_PMD_NR)
604  __SetPageUptodate(page)
606  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' )
607  如果此条件成立可能性小(为编译器优化)(!pmd_none( * Pointer to pmd entry matching* the 'address' ))则
608  转到:unlock_release
609  否则
612  ret等于Checks whether a page fault on the given mm is still reliable
613  如果ret则转到:unlock_release
617  如果userfaultfd_missing(vma)则
626  返回:ret2
629  entry等于mk_huge_pmd(page, Access permissions of this VMA. )
630  entry等于maybe_pmd_mkwrite(pmd_mkdirty(entry), vma)
631  page_add_new_anon_rmap - add pte mapping to a new anonymous page*@page: the page to add the mapping to*@vma: the vm area in which the mapping is added*@address: the user virtual address mapped*@compound: charge the page as compound or small page
632  mem_cgroup_commit_charge(page, memcg, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., true)
633  lru_cache_add_active_or_unevictable*@page: the page to be added to LRU*@vma: vma in which page is mapped for determining reclaimability* Place @page on the active or unevictable LRU list, depending on its* evictability
634  pgtable_trans_huge_deposit(The address space we belong to. , Pointer to pmd entry matching* the 'address' , pgtable)
635  set_pmd_at(The address space we belong to. , haddr, Pointer to pmd entry matching* the 'address' , entry)
636  add_mm_counter(The address space we belong to. , MM_ANONPAGES, HPAGE_PMD_NR)
637  mm_inc_nr_ptes(The address space we belong to. )
638  自旋锁解锁
639  Disable counters
640  count_memcg_events(memcg, THP_FAULT_ALLOC, 1)
643  返回:0
644  unlock_release :
645  自旋锁解锁
646  release :
647  如果pgtablepte_free - free PTE-level user page table page*@mm: the mm_struct of the current context*@pte_page: the `struct page` representing the page table
649  mem_cgroup_cancel_charge(page, memcg, true)
650  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
651  返回:ret
调用者
名称描述
do_huge_pmd_anonymous_page