Function report |
Source Code:mm\hugetlb.c |
Create Date:2022-07-28 15:26:27 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Allocates a fresh surplus page from the page allocator.
Proto:static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, int nid, nodemask_t *nmask)
Type:struct page
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct hstate * | h | |
| gfp_t | gfp_mask | |
| int | nid | |
| nodemask_t * | nmask |
| 1557 | If hstate_is_gigantic(h) Then Return NULL |
| 1560 | spin_lock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.) |
| 1561 | If surplus_huge_pages >= nr_overcommit_huge_pages Then Go to out_unlock |
| 1563 | spin_unlock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.) |
| 1565 | page = Common helper to allocate a fresh hugetlb page. All specific allocators* should use this function to get new hugetlb pages |
| 1566 | If Not page Then Return NULL |
| 1569 | spin_lock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.) |
| 1577 | If surplus_huge_pages >= nr_overcommit_huge_pages Then |
| 1578 | SetPageHugeTemporary(page) |
| 1579 | spin_unlock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.) |
| 1581 | Return NULL |
| 1582 | Else |
| 1583 | surplus_huge_pages++ |
| 1584 | surplus_huge_pages_node[page_to_nid(page)]++ |
| 1587 | out_unlock : |
| 1588 | spin_unlock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.) |
| 1590 | Return page |
| Name | Describe |
|---|---|
| alloc_buddy_huge_page_with_mpol | Use the VMA's mpolicy to allocate a huge page from the buddy. |
| gather_surplus_pages | Increase the hugetlb pool such that it can accommodate a reservation* of size 'delta'. |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |