Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\percpu.c Create Date:2022-07-28 14:26:18
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_free - updates the block hints on the free path*@chunk: chunk of interest*@bit_off: chunk offset*@bits: size of request* Updates metadata for the allocation path. This avoids a blind block

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

Type:void

Parameter:

TypeParameterName
struct pcpu_chunk *chunk
intbit_off
intbits
934  nr_empty_pages = 0
946  s_index = pcpu_off_to_block_index(bit_off)
947  e_index = pcpu_off_to_block_index(bit_off + bits - 1)
948  s_off = pcpu_off_to_block_off(bit_off)
949  e_off = pcpu_off_to_block_off(bit_off + bits - 1) + 1
951  s_block = metadata blocks + s_index
952  e_block = metadata blocks + e_index
964  start = s_off
965  If s_off == contig hint for block + lock relative startingposition of the contig hint Then
966  start = lock relative startingposition of the contig hint
967  Else
974  l_bit = find_last_bit(The following are helper functions to help access bitmaps and convert* between bitmap offsets to address offsets., start)
976  start = If start == l_bit Then 0 Else l_bit + 1
979  end = e_off
980  If e_off == lock relative startingposition of the contig hint Then end = lock relative startingposition of the contig hint + contig hint for block
982  Else end = Find the next set bit in a memory region.
987  e_off = If s_index == e_index Then end Else PCPU_BITMAP_BLOCK_BITS
988  If Not start && e_off == PCPU_BITMAP_BLOCK_BITS Then nr_empty_pages++
990  pcpu_block_update - updates a block given a free area*@block: block of interest*@start: start offset in block*@end: end offset in block* Updates a block given a known free area. The region [start, end) is
993  If s_index != e_index Then
995  If end == PCPU_BITMAP_BLOCK_BITS Then nr_empty_pages++
997  pcpu_block_update - updates a block given a free area*@block: block of interest*@start: start offset in block*@end: end offset in block* Updates a block given a known free area. The region [start, end) is
1000  nr_empty_pages += e_index - s_index - 1
1001  When block < e_block cycle
1011  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
1020  If end - start >= PCPU_BITMAP_BLOCK_BITS || s_index != e_index 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
1022  Else pcpu_block_update - updates a block given a free area*@block: block of interest*@start: start offset in block*@end: end offset in block* Updates a block given a known free area. The region [start, end) is
Caller
NameDescribe
pcpu_free_areapcpu_free_area - frees the corresponding offset*@chunk: chunk of interest*@off: addr offset into chunk* This function determines the size of an allocation to free using* the boundary bitmap and clears the allocation map.