Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits, size_t align, bool pop_only)

Type:int

Parameter:

TypeParameterName
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  If bit_off + alloc_bits > contig hint for block Then Return -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  If Not pop_only || pcpu_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 Then Break
1101  bit_off = next_off
1102  bits = 0
1105  If 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. Then Return -1
1108  Return bit_off
Caller
NameDescribe
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