函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:pcpu_find_block_fit - finds the block index to start searching*@chunk: chunk of interest*@alloc_bits: size of request in allocation units*@align: alignment of area (max PAGE_SIZE bytes)*@pop_only: use populated regions only* Given a chunk and an

函数原型:static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits, size_t align, bool pop_only)

返回类型:int

参数:

类型参数名称
struct pcpu_chunk *chunk
intalloc_bits
size_talign
boolpop_only
1080  chunk_md等于chunk_md
1089  bit_off等于@a is a power of 2 value (lock relative startingposition of the contig hint , align)减lock relative startingposition of the contig hint
1091  如果bit_offalloc_bits大于contig hint for block 则返回:负1
1094  bit_off等于pcpu_next_hint - determine which hint to use*@block: block of interest*@alloc_bits: size of allocation* This determines if we should scan based on the scan_hint or first_free.* In general, we want to scan from first_free to fulfill allocations by
1095  bits等于0
1097  如果非pop_onlypcpu_is_populated - determines if the region is populated*@chunk: chunk of interest*@bit_off: chunk offset*@bits: size of area*@next_off: return value for the next offset to start searching* For atomic allocations, check if the backing pages are populated退出
1101  bit_off等于next_off
1102  bits等于0
1105  如果bit_off恒等于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.则返回:负1
1108  返回:bit_off
调用者
名称描述
pcpu_allocpcpu_alloc - the percpu allocator*@size: size of area to allocate in bytes*@align: alignment of area (max PAGE_SIZE)*@reserved: allocate from the reserved chunk if available*@gfp: allocation flags* Allocate percpu area of @size bytes aligned at @align