Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\huge_memory.c Create Date:2022-07-28 16:00:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_huge_zero_page

Proto:static struct page *get_huge_zero_page(void)

Type:struct page

Parameter:Nothing

83  retry :
84  If Value is more likely to compile time(atomic_inc_not_zero - increment unless the number is zero*@v: pointer of type atomic_t* Atomically increments @v by 1, if @v is non-zero.* Returns true if the increment was done.) Then Return READ_ONCE(huge_zero_page)
87  zero_page = alloc_pages((GFP_TRANSHUGE | __GFP_ZERO) & ~ZONE_MOVABLE allowed , HPAGE_PMD_ORDER)
89  If Not zero_page Then
90  Disable counters
91  Return NULL
93  Disable counters
94  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
95  If cmpxchg( & huge_zero_page, NULL, zero_page) Then
96  preempt_enable()
97  __free_pages(zero_page, compound_order(zero_page))
98  Go to retry
102  atomic_set( & huge_zero_refcount, 2)
103  preempt_enable()
104  Return READ_ONCE(huge_zero_page)
Caller
NameDescribe
mm_get_huge_zero_page