函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\setup_percpu.c Create Date:2022-07-27 09:25:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:SMP体系CPU分配内存

函数原型:void __init setup_per_cpu_areas(void)

返回类型:void

参数:

174  打印信息("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%u nr_node_ids:%u\n", CPU数量, nr_cpumask_bits, nr_cpu_ids, nr_node_ids)
184  如果多核内存分配机制恒等于PCPU_FC_AUTO确定percpu分配需要考虑NUMA多核内存分配机制等于PCPU_FC_PAGE
187  rc等于负EINVAL
188  如果多核内存分配机制不等于PCPU_FC_PAGE
189  dyn_size等于ugh to cover all DEFINE_PER_CPUs in modules PERCPU_DYNAMIC_RESERVEOn x86_64 symbols referenced from code should be reachable using* 32bit relocations. Reserve space for static percpu variables in* modules so that they are always served from the first chunk which* is located at the percpu segment base
201  atom_size等于PMD_SIZE
205  rc等于pcpu_embed_first_chunk(On x86_64 symbols referenced from code should be reachable using* 32bit relocations. Reserve space for static percpu variables in* modules so that they are always served from the first chunk which* is located at the percpu segment base, dyn_size, atom_size, pcpu_cpu_distance, Helpers for first chunk memory allocation, pcpu_fc_free)
209  如果rc小于0则打印警告信息("%s allocator failed (%d), falling back to page size\n", pcpu_fc_names[多核内存分配机制], rc)
213  如果rc小于0则rc等于pcpu_page_first_chunk(On x86_64 symbols referenced from code should be reachable using* 32bit relocations. Reserve space for static percpu variables in* modules so that they are always served from the first chunk which* is located at the percpu segment base, Helpers for first chunk memory allocation, pcpu_fc_free, pcpup_populate_pte)
217  如果rc小于0则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
221  delta等于pcpu_base_addr__per_cpu_start
222  遍历可用CPU(cpu)
223  per_cpu_offset(cpu)等于deltapcpu_unit_offsets[cpu]
224  per_cpu(this_cpu_off, cpu)等于per_cpu_offset(cpu)
225  per_cpu(cpu_number, cpu)等于cpu
226  setup_percpu_segment(cpu)
227  dummy boot_init_stack_canary() is defined in linux/stackprotector.h
244  per_cpu(x86_cpu_to_logical_apicid, cpu)等于early_per_cpu_map(x86_cpu_to_logical_apicid, cpu)
248  per_cpu(Mappings between logical cpu number and node number , cpu)等于early_per_cpu_map(Mappings between logical cpu number and node number , cpu)
258  set_cpu_numa_node(cpu, 取得CPU的NUMA节点)
264  如果非cpuCurrent gdt points %fs at the "master" per-cpu area: after this,* it's on the real one.
275  early_per_cpu_ptr(x86_cpu_to_logical_apicid) = NULL
278  early_per_cpu_ptr(Mappings between logical cpu number and node number ) = NULL
282  setup_node_to_cpumask_map()
285  rrectly size the local cpu masks
297  sync_initial_page_table()
调用者
名称描述
start_kernel启动内核