Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\percpu.c Create Date:2022-07-28 14:26:43
Last Modify:2022-05-23 13:52:24 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pcpu_alloc_chunk

Proto:static struct pcpu_chunk *pcpu_alloc_chunk(gfp_t gfp)

Type:struct pcpu_chunk

Parameter:

TypeParameterName
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  If Not chunk Then Return NULL
1413  Initialization list head
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  If Not allocation map Then Go to 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  If Not boundary map Then Go to 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  If Not metadata blocks Then Go to md_blocks_fail
1432  pcpu_init_md_blocks(chunk)
1435  free bytes in the chunk = # of pages served by this chunk * PAGE_SIZE
1437  Return 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  Return NULL