Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:pcpu_alloc_pages - allocates pages for @chunk*@chunk: target chunk*@pages: array to put the allocated pages into, indexed by pcpu_page_idx()*@page_start: page index of the first page to be allocated*@page_end: page index of the last page to be allocated +

Proto:static int pcpu_alloc_pages(struct pcpu_chunk *chunk, struct page **pages, int page_start, int page_end, gfp_t gfp)

Type:int

Parameter:

TypeParameterName
struct pcpu_chunk *chunk
struct page **pages
intpage_start
intpage_end
gfp_tgfp
88  gfp |= __GFP_HIGHMEM
90  for_each_possible_cpu(cpu)
91  When i < page_end cycle
95  If Not pagep Then Go to err
99  Return 0
101  err :
102  When --i >= page_start cycle
103  __free_page(pages[pcpu_page_idx(cpu, i)])
105  for_each_possible_cpu(tcpu)
106  If tcpu == cpu Then Break
108  When i < page_end cycle __free_page(pages[pcpu_page_idx(tcpu, i)])
111  Return -ENOMEM