函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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 +

函数原型:static int pcpu_alloc_pages(struct pcpu_chunk *chunk, struct page **pages, int page_start, int page_end, gfp_t gfp)

返回类型:int

参数:

类型参数名称
struct pcpu_chunk *chunk
struct page **pages
intpage_start
intpage_end
gfp_tgfp
88  gfp或等于__GFP_HIGHMEM
90  遍历可用CPU(cpu)
91 i小于page_end循环
92  pagep等于pages[pcpu_page_idx(cpu, i)]
95  如果非pagep则转到:err
99  返回:0
101  err :
102 i先自减大于等于page_start循环
103  __free_page(pages[pcpu_page_idx(cpu, i)])
105  遍历可用CPU(tcpu)
106  如果tcpu恒等于cpu退出
108 i小于page_end循环__free_page(pages[pcpu_page_idx(tcpu, i)])
111  返回:负ENOMEM
调用者
名称描述
pcpu_populate_chunkpcpu_populate_chunk - populate and map an area of a pcpu_chunk*@chunk: chunk of interest*@page_start: the start page*@page_end: the end page*@gfp: allocation flags passed to the underlying memory allocator* For each cpu, populate and map pages