函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\percpu.c Create Date:2022-07-27 15:51:11
Last Modify:2022-05-23 13:52:24 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:pcpu_alloc_chunk

函数原型:static struct pcpu_chunk *pcpu_alloc_chunk(gfp_t gfp)

返回类型:struct pcpu_chunk

参数:

类型参数名称
gfp_tgfp
1409  chunk等于pcpu_mem_zalloc - allocate memory*@size: bytes to allocate*@gfp: allocation flags* Allocate @size bytes. If @size is smaller than PAGE_SIZE,* kzalloc() is used; otherwise, the equivalent of vzalloc() is used.
1410  如果非chunk则返回:NULL
1413  初始化链表头
1414  # of pages served by this chunk 等于pcpu_unit_pages
1415  region_bits等于pcpu_chunk_map_bits - helper to convert nr_pages to size of bitmap*@chunk: chunk of interest* This conversion is from the number of physical pages that the chunk* serves to the number of bits in the bitmap.
1417  allocation map 等于pcpu_mem_zalloc - allocate memory*@size: bytes to allocate*@gfp: allocation flags* Allocate @size bytes. If @size is smaller than PAGE_SIZE,* kzalloc() is used; otherwise, the equivalent of vzalloc() is used.
1419  如果非 allocation map 则转到:alloc_map_fail
1422  boundary map 等于pcpu_mem_zalloc - allocate memory*@size: bytes to allocate*@gfp: allocation flags* Allocate @size bytes. If @size is smaller than PAGE_SIZE,* kzalloc() is used; otherwise, the equivalent of vzalloc() is used.
1424  如果非 boundary map 则转到:bound_map_fail
1427  metadata blocks 等于pcpu_mem_zalloc - allocate memory*@size: bytes to allocate*@gfp: allocation flags* Allocate @size bytes. If @size is smaller than PAGE_SIZE,* kzalloc() is used; otherwise, the equivalent of vzalloc() is used.
1429  如果非 metadata blocks 则转到:md_blocks_fail
1432  pcpu_init_md_blocks(chunk)
1435  free bytes in the chunk 等于 # of pages served by this chunk PAGE_SIZE
1437  返回:chunk
1439  md_blocks_fail :
1440  pcpu_mem_free - free memory*@ptr: memory to free* Free @ptr. @ptr should have been allocated using pcpu_mem_zalloc().
1441  bound_map_fail :
1442  pcpu_mem_free - free memory*@ptr: memory to free* Free @ptr. @ptr should have been allocated using pcpu_mem_zalloc().
1443  alloc_map_fail :
1444  pcpu_mem_free - free memory*@ptr: memory to free* Free @ptr. @ptr should have been allocated using pcpu_mem_zalloc().
1446  返回:NULL
调用者
名称描述
pcpu_create_chunk