函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:alloc_huge_page

函数原型:struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve)

返回类型:struct page

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddr
intavoid_reserve
1998  spool等于subpool_vma(vma)
1999  h等于hstate_vma(vma)
2006  idx等于hstate_index(h)
2012  map_chg等于gbl_chg等于vma_needs_reservation(h, vma, addr)
2013  如果map_chg小于0则返回:错误号
2023  如果map_chgavoid_reserve
2024  gbl_chg等于Subpool accounting for allocating and reserving pages
2025  如果gbl_chg小于0则
2027  返回:错误号
2038  如果avoid_reservegbl_chg等于1
2042  ret等于hugetlb_cgroup_charge_cgroup(idx, pages_per_huge_page(h), & h_cg)
2043  如果ret则转到:out_subpool_put
2046  加自旋锁
2052  page等于dequeue_huge_page_vma(h, vma, addr, avoid_reserve, gbl_chg)
2053  如果非page
2054  自旋锁解锁
2055  page等于Use the VMA's mpolicy to allocate a huge page from the buddy.
2056  如果非page则转到:out_uncharge_cgroup
2060  resv_huge_pages自减
2062  加自旋锁
2063  链表项移动到头部
2066  Should be called with hugetlb_lock held
2067  自旋锁解锁
2069  set_page_private(page, (unsignedlong)spool)
2071  map_commit等于vma_commit_reservation(h, vma, addr)
2072  如果此条件成立可能性小(为编译器优化)(map_chg > map_commit)则
2084  rsv_adjust等于Subpool accounting for freeing and unreserving pages.* Return the number of global page reservations that must be dropped.* The return value may only be different than the passed value (delta)* in the case where a subpool minimum size must be maintained.
2085  Forward declaration
2087  返回:page
2089  out_uncharge_cgroup :
2090  hugetlb_cgroup_uncharge_cgroup(idx, pages_per_huge_page(h), h_cg)
2091  out_subpool_put :
2092  如果map_chgavoid_reserveSubpool accounting for freeing and unreserving pages.* Return the number of global page reservations that must be dropped.* The return value may only be different than the passed value (delta)* in the case where a subpool minimum size must be maintained.
2094  vma_end_reservation(h, vma, addr)
2095  返回:错误号
调用者
名称描述
hugetlb_cowHugetlb_cow() should be called with page lock of the original hugepage held.* Called with hugetlb_instantiation_mutex held and pte_page locked so we* cannot race with other handlers or page migration.
hugetlb_no_page
hugetlb_mcopy_atomic_pteUsed by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages.