函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

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

返回类型:void

参数:

类型参数名称
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 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.循环
430  如果bits
432  如果bits大于等于alloc_bits则返回
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  返回
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_BITSbit_off
461  bit_off等于pcpu_block_off_to_off(i, * bit_off)
462  如果bits大于等于alloc_bits则返回
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.