Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static void pcpu_block_update_hint_alloc(struct pcpu_chunk *chunk, int bit_off, int bits)

Type:void

Parameter:

TypeParameterName
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  If contig hint for block == PCPU_BITMAP_BLOCK_BITS Then nr_empty_pages++
816  If s_off == lock position of first free Then lock position of first free = Find the next zero bit in a memory region.
822  If 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) Then scan hint for block = 0
828  If 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) Then
834  If Not s_off Then size 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  Else
839  size of free space alongthe left side of the block = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(size of free space alongthe left side of the block , s_off)
840  If s_index == e_index Then size 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  Else size of free space alongthe right side of the block = 0
850  If s_index != e_index Then
851  If contig hint for block == PCPU_BITMAP_BLOCK_BITS Then nr_empty_pages++
858  lock position of first free = Find the next zero bit in a memory region.
862  If e_off == PCPU_BITMAP_BLOCK_BITS Then
864  e_block++
865  Else
873  Else
881  nr_empty_pages += e_index - s_index - 1
882  When block < e_block cycle
890  If nr_empty_pages Then pcpu_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  If 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) Then scan hint for block = 0
905  If 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) Then 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
Caller
NameDescribe
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