Function report |
Source Code:mm\percpu.c |
Create Date:2022-07-28 14:26:40 |
Last Modify:2022-05-23 13:52:24 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:pcpu_alloc_first_chunk - creates chunks that serve the first chunk*@tmp_addr: the start of the region served*@map_size: size of the region served* This is responsible for creating the chunks that serve the first chunk
Proto:static struct pcpu_chunk *__init pcpu_alloc_first_chunk(unsigned long tmp_addr, int map_size)
Type:struct pcpu_chunk
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned long | tmp_addr | |
int | map_size |
1317 | aligned_addr = tmp_addr & PAGE_MASK |
1319 | start_offset = tmp_addr - aligned_addr |
1326 | lcm_align = Lowest common multiple |
1327 | region_size = @a is a power of 2 value (start_offset + map_size, lcm_align) |
1330 | alloc_size = sizeof(structpcpu_chunk) + BITS_TO_LONGS(region_size >> PAGE_SHIFT determines the page size ) |
1332 | chunk = memblock_alloc(alloc_size, SMP_CACHE_BYTES) |
1333 | If Not chunk Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
1341 | additional area required to have the region end page aligned = region_size - the overlap with the previous region to have a page aligned base_addr - map_size |
1346 | alloc_size = BITS_TO_LONGS(region_bits) * size of allocation map [0] |
1348 | If Not allocation map Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
1352 | alloc_size = BITS_TO_LONGS(region_bits + 1) * size of boundary map [0] |
1355 | If Not boundary map Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
1361 | If Not metadata blocks Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
1365 | pcpu_init_md_blocks(chunk) |
1368 | no [de]population allowed = true |
1373 | free bytes in the chunk = map_size |
1377 | offset_bits = the overlap with the previous region to have a page aligned base_addr / PCPU_MIN_ALLOC_SIZE |
1378 | bitmap_set( allocation map , 0, offset_bits) |
1389 | offset_bits = additional area required to have the region end page aligned / PCPU_MIN_ALLOC_SIZE |
1401 | Return chunk |
Name | Describe |
---|---|
pcpu_setup_first_chunk | pcpu_setup_first_chunk - initialize the first percpu chunk*@ai: pcpu_alloc_info describing how to percpu area is shaped*@base_addr: mapped address* Initialize the first percpu chunk which contains the kernel static* percpu area |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |