函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off, int bits)

返回类型:void

参数:

类型参数名称
struct pcpu_chunk *chunk
intbit_off
intbits
787  chunk_md等于chunk_md
788  nr_empty_pages等于0
799  s_index等于pcpu_off_to_block_index(bit_off)
800  e_index等于pcpu_off_to_block_index(bit_off + bits - 1)
801  s_off等于pcpu_off_to_block_off(bit_off)
802  e_off等于pcpu_off_to_block_off(bit_off + bits - 1)加1
804  s_block等于 metadata blocks s_index
805  e_block等于 metadata blocks e_index
813  如果contig hint for block 恒等于PCPU_BITMAP_BLOCK_BITSnr_empty_pages自加
816  如果s_off恒等于lock position of first free lock position of first free 等于在内存区域中查找下一个零位
822  如果pcpu_region_overlap - determines if two regions overlap*@a: start of first region, inclusive*@b: end of first region, exclusive*@x: start of second region, inclusive*@y: end of second region, exclusive* This is used to determine if the hint region [a, b) scan hint for block 等于0
828  如果pcpu_region_overlap - determines if two regions overlap*@a: start of first region, inclusive*@b: end of first region, exclusive*@x: start of second region, inclusive*@y: end of second region, exclusive* This is used to determine if the hint region [a, b)
834  如果非s_offsize of free space alongthe left side of the block 等于0
836  pcpu_block_refresh_hint*@chunk: chunk of interest*@index: index of the metadata block* Scans over the block beginning at first_free and updates the block* metadata accordingly.
837  否则
839  size of free space alongthe left side of the block 等于两数取小(size of free space alongthe left side of the block , s_off)
840  如果s_index恒等于e_indexsize of free space alongthe right side of the block 等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(int, size of free space alongthe right side of the block , PCPU_BITMAP_BLOCK_BITS - e_off)
843  否则size of free space alongthe right side of the block 等于0
850  如果s_index不等于e_index
851  如果contig hint for block 恒等于PCPU_BITMAP_BLOCK_BITSnr_empty_pages自加
858  lock position of first free 等于在内存区域中查找下一个零位
862  如果e_off恒等于PCPU_BITMAP_BLOCK_BITS
864  e_block自加
865  否则
873  否则
881  nr_empty_pages加等于e_indexs_index减1
882 block小于e_block循环
883  scan hint for block 等于0
884  contig hint for block 等于0
890  如果nr_empty_pagespcpu_update_empty_pages - update empty page counters*@chunk: chunk of interest*@nr: nr of empty pages* This is used to keep track of the empty pages now based on the premise* a md_block covers a page. The hint update functions recognize if a block
893  如果pcpu_region_overlap - determines if two regions overlap*@a: start of first region, inclusive*@b: end of first region, exclusive*@x: start of second region, inclusive*@y: end of second region, exclusive* This is used to determine if the hint region [a, b) scan hint for block 等于0
905  如果pcpu_region_overlap - determines if two regions overlap*@a: start of first region, inclusive*@b: end of first region, exclusive*@x: start of second region, inclusive*@y: end of second region, exclusive* This is used to determine if the hint region [a, b) pcpu_chunk_refresh_hint - updates metadata about a chunk*@chunk: chunk of interest*@full_scan: if we should scan from the beginning* Iterates over the metadata blocks to find the largest contig area
调用者
名称描述
pcpu_alloc_areapcpu_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
pcpu_alloc_first_chunkpcpu_alloc_first_chunk - creates chunks that serve the first chunk*@tmp_addr: the start of the region served*@map_size: size of the region served* This is responsible for creating the chunks that serve the first chunk