函数逻辑报告 |
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 |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称: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 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 |
| 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(). |
| 8084 | 如果非high_limit则 |
| 8087 | 以adapt小于numentries循环scale自加 |
| 8094 | 如果scale大于PAGE_SHIFT determines the page size 则numentries右移等于scale减PAGE_SHIFT determines the page size 位 |
| 8096 | 否则numentries左移等于PAGE_SHIFT determines the page size 减scale位 |
| 8102 | WARN_ON(!(flags & Allocating during early boot? )) |
| 8103 | 如果非numentries右移_hash_shift位的值则 |
| 8104 | numentries等于1UL左移_hash_shift位 |
| 8105 | BUG_ON(!numentries) |
| 8107 | 否则如果此条件成立可能性小(为编译器优化)((numentries * bucketsize) < PAGE_SIZE)则numentries等于PAGE_SIZE除bucketsize |
| 8113 | 如果max恒等于0则 |
| 8114 | max等于nr_all_pages左移PAGE_SHIFT determines the page size 位右移4位 |
| 8119 | 如果numentries小于low_limit则numentries等于low_limit |
| 8121 | 如果numentries大于max则numentries等于max |
| 8127 | 循环 |
| 8128 | virt = false |
| 8129 | size等于bucketsize左移log2qty位 |
| 8130 | 如果flags按位与Allocating during early boot? 则 |
| 8131 | 如果flags按位与Zero allocated hash table 则table等于memblock_alloc(size, SMP_CACHE_BYTES) |
| 8133 | 否则table等于memblock_alloc_raw(size, SMP_CACHE_BYTES) |
| 8139 | 否则 |
| 8146 | kmemleak_alloc(table, size, 1, gfp_flags) |
| 8150 | 如果非table则panic - 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_early | Initialize the waitqueues and inode hash table. |
| inode_init | |
| mnt_init | |
| futex_init | |
| dcache_init_early |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |