函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:pcpu_alloc_alloc_info - allocate percpu allocation info*@nr_groups: the number of groups*@nr_units: the number of units* Allocate ai which is large enough for @nr_groups groups containing*@nr_units units

函数原型:struct pcpu_alloc_info *__init pcpu_alloc_alloc_info(int nr_groups, int nr_units)

返回类型:struct pcpu_alloc_info

参数:

类型参数名称
intnr_groups
intnr_units
2128  base_size等于@a is a power of 2 value (struct_size() - Calculate size of structure with trailing array.*@p: Pointer to the structure.*@member: Name of the array member.*@n: Number of elements in the array.* Calculates size of memory needed for structure @p followed by an(ai, groups, nr_groups), __alignof__(cpu_map[0]))
2130  ai_size等于base_sizenr_units unit->cpu map, empty * entries contain NR_CPUS [0]的长度
2132  ptr等于memblock_alloc(PFN_ALIGN(ai_size), PAGE_SIZE)
2133  如果非ptr则返回:NULL
2135  ai等于ptr
2136  ptr加等于base_size
2138  unit->cpu map, empty * entries contain NR_CPUS 等于ptr
2140 unit小于nr_units循环 unit->cpu map, empty * entries contain NR_CPUS [unit]等于CPU数量
2143  0 if grouping unnecessary 等于nr_groups
2144  internal, don't use 等于PFN_ALIGN(ai_size)
2146  返回:ai
调用者
名称描述
setup_per_cpu_areasUP percpu area setup.* UP always uses km-based percpu allocator with identity mapping.* Static percpu variables are indistinguishable from the usual static* variables and don't require any special preparation.