函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:pcpu_alloc_area - allocates an area from a pcpu_chunk*@chunk: chunk of interest*@alloc_bits: size of request in allocation units*@align: alignment of area (max PAGE_SIZE)*@start: bit_off to start searching* This function takes in a @start offset to begin

函数原型:static int pcpu_alloc_area(struct pcpu_chunk *chunk, int alloc_bits, size_t align, int start)

返回类型:int

参数:

类型参数名称
struct pcpu_chunk *chunk
intalloc_bits
size_talign
intstart
1189  chunk_md等于chunk_md
1190  align_mask等于如果alignalign减1否则0
1191  area_off等于0, area_bits等于0
1194  lockdep_assert_held( & pcpu_lock)
1196  oslot等于pcpu_chunk_slot(chunk)
1201  end等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(int, start + alloc_bits + PCPU_BITMAP_BLOCK_BITS, 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.)
1203  bit_off等于pcpu_find_zero_area - modified from bitmap_find_next_zero_area_off()*@map: the address to base the search on*@size: the bitmap size in bits*@start: the bitnumber to start searching at*@nr: the number of zeroed bits we're looking for*@align_mask: alignment
1205  如果bit_off大于等于end则返回:负1
1208  如果area_bitspcpu_block_update_scan - update a block given a free area from a scan*@chunk: chunk of interest*@bit_off: chunk offset*@bits: size of free area* Finding the final allocation spot first goes through pcpu_find_block_fit()* to find a block that can hold the
1212  bitmap_set( allocation map , bit_off, alloc_bits)
1215  设置内存位
1216  bitmap_clear( boundary map , bit_off + 1, alloc_bits - 1)
1217  设置内存位
1219  free bytes in the chunk 减等于alloc_bitsPCPU_MIN_ALLOC_SIZE
1222  如果bit_off恒等于lock position of first free lock position of first free 等于在内存区域中查找下一个零位
1228  pcpu_block_update_hint_alloc - update hint on allocation path*@chunk: chunk of interest*@bit_off: chunk offset*@bits: size of request* Updates metadata for the allocation path. The metadata only has to be
1230  pcpu_chunk_relocate - put chunk in the appropriate chunk slot*@chunk: chunk of interest*@oslot: the previous slot it was on* This function is called after an allocation or free changed @chunk
1232  返回:bit_offPCPU_MIN_ALLOC_SIZE
调用者
名称描述
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