函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-27 16:38:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:allocate a large system hash table from bootmem* - it is assumed that the hash table must contain an exact power-of-2* quantity of entries* - limit is the number of hash buckets, not the total allocation size

函数原型:void *__init alloc_large_system_hash(const char *tablename, unsigned long bucketsize, unsigned long numentries, int scale, int flags, unsigned int *_hash_shift, unsigned int *_hash_mask, unsigned long low_limit, unsigned long high_limit)

返回类型:void

参数:

类型参数名称
const char *tablename
unsigned longbucketsize
unsigned longnumentries
intscale
intflags
unsigned int *_hash_shift
unsigned int *_hash_mask
unsigned longlow_limit
unsigned longhigh_limit
8067  max等于high_limit
8069  void * table = NULL
8074  如果非numentries
8076  numentries等于nr_kernel_pages
8077  numentries减等于Returns the number of pages that arch has reserved but* is not known to alloc_large_system_hash().
8080  如果PAGE_SHIFT determines the page size 小于20则numentries等于und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(numentries, (1 << 20) / PAGE_SIZE)
8084  如果非high_limit
8087 adapt小于numentries循环scale自加
8094  如果scale大于PAGE_SHIFT determines the page size numentries右移等于scalePAGE_SHIFT determines the page size
8096  否则numentries左移等于PAGE_SHIFT determines the page size scale
8103  如果非numentries右移_hash_shift位的值则
8104  numentries等于1UL左移_hash_shift
8105  BUG_ON(!numentries)
8107  否则如果此条件成立可能性小(为编译器优化)((numentries * bucketsize) < PAGE_SIZE)则numentries等于PAGE_SIZEbucketsize
8110  numentries等于undup_pow_of_two - round the given value up to nearest power of two*@n: parameter* round the given value up to the nearest power of two* - the result is undefined when n == 0* - this can be used to initialise global variables from constant data(numentries)
8113  如果max恒等于0则
8114  max等于nr_all_pages左移PAGE_SHIFT determines the page size 位右移4位
8115  do_div() is NOT a C function(max, bucketsize)
8117  max等于两数取小(max, 0x80000000ULL)
8119  如果numentries小于low_limitnumentries等于low_limit
8121  如果numentries大于maxnumentries等于max
8124  log2qty等于log2 - log base 2 of 32-bit or a 64-bit unsigned value*@n: parameter* constant-capable log of base 2 calculation* - this can be used to initialise global variables from constant data, hence* the massive ternary operator construction* selects the (numentries)
8126  gfp_flags等于如果flags按位与Zero allocated hash table DOC: Useful GFP flag combinations* Useful GFP flag combinations* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~* Useful GFP flag combinations that are commonly used. It is recommended* that subsystems start with one of these combinations and then set/clear按位或__GFP_ZERO否则DOC: Useful GFP flag combinations* Useful GFP flag combinations* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~* Useful GFP flag combinations that are commonly used. It is recommended* that subsystems start with one of these combinations and then set/clear
8127  循环
8128  virt = false
8129  size等于bucketsize左移log2qty
8130  如果flags按位与Allocating during early boot?
8138  virt = true
8139  否则
8148  当非tablesize大于PAGE_SIZElog2qty先自减循环
8150  如果非tablepanic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
8153  打印信息("%s hash table entries: %ld (order: %d, %lu bytes, %s)\n", tablename, 1UL << log2qty, log2 - log base 2 of 32-bit or a 64-bit unsigned value*@n: parameter* constant-capable log of base 2 calculation* - this can be used to initialise global variables from constant data, hence* the massive ternary operator construction* selects the (size) - PAGE_SHIFT determines the page size , size, virt ? "vmalloc" : "linear")
8157  如果_hash_shift_hash_shift等于log2qty
8159  如果_hash_mask_hash_mask等于1左移log2qty位的值减1
8162  返回:table
调用者
名称描述
dcache_init
inode_init_earlyInitialize the waitqueues and inode hash table.
inode_init
mnt_init
futex_init
dcache_init_early