函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Allocates a fresh surplus page from the page allocator.

函数原型:static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, int nid, nodemask_t *nmask)

返回类型:struct page

参数:

类型参数名称
struct hstate *h
gfp_tgfp_mask
intnid
nodemask_t *nmask
1555  struct page * page = NULL
1557  如果hstate_is_gigantic(h)则返回:NULL
1560  加自旋锁
1561  如果surplus_huge_pages大于等于nr_overcommit_huge_pages则转到:out_unlock
1563  自旋锁解锁
1565  page等于Common helper to allocate a fresh hugetlb page. All specific allocators* should use this function to get new hugetlb pages
1566  如果非page则返回:NULL
1569  加自旋锁
1577  如果surplus_huge_pages大于等于nr_overcommit_huge_pages
1578  SetPageHugeTemporary(page)
1579  自旋锁解锁
1580  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1581  返回:NULL
1582  否则
1583  surplus_huge_pages自加
1584  surplus_huge_pages_node[page_to_nid(page)]自加
1587  out_unlock :
1588  自旋锁解锁
1590  返回:page
调用者
名称描述
alloc_buddy_huge_page_with_mpolUse the VMA's mpolicy to allocate a huge page from the buddy.
gather_surplus_pagesIncrease the hugetlb pool such that it can accommodate a reservation* of size 'delta'.