Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:pcpu_next_fit_region - finds fit areas for a given allocation request*@chunk: chunk of interest*@alloc_bits: size of allocation*@align: alignment of area (max PAGE_SIZE)*@bit_off: chunk offset*@bits: size of free area* Finds the next free region that is

Proto:static void pcpu_next_fit_region(struct pcpu_chunk *chunk, int alloc_bits, int align, int *bit_off, int *bits)

Type:void

Parameter:

TypeParameterName
struct pcpu_chunk *chunk
intalloc_bits
intalign
int *bit_off
int *bits
422  i = pcpu_off_to_block_index( * bit_off)
423  block_off = pcpu_off_to_block_off( * bit_off)
426  bits = 0
427  When i < pcpu_chunk_nr_blocks - converts nr_pages to # of md_blocks*@chunk: chunk of interest* This conversion is from the number of physical pages that the chunk* serves to the number of bitmap blocks used. cycle
430  If bits Then
432  If bits >= alloc_bits Then Return
439  bits = @a is a power of 2 value (lock relative startingposition of the contig hint , align) - lock relative startingposition of the contig hint
453  Return
456  block_off = 0
458  bit_off = @a is a power of 2 value (PCPU_BITMAP_BLOCK_BITS - size of free space alongthe right side of the block , align)
460  bits = PCPU_BITMAP_BLOCK_BITS - bit_off
461  bit_off = pcpu_block_off_to_off(i, * bit_off)
462  If bits >= alloc_bits Then Return
467  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.