Function report |
Source Code:mm\page_alloc.c |
Create Date:2022-07-28 15:08:34 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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
Proto: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)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| 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 | If Not numentries Then |
| 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 | If Not high_limit Then |
| 8087 | When adapt < numentries cycle scale++ |
| 8094 | If scale > PAGE_SHIFT determines the page size Then numentries >>= scale - PAGE_SHIFT determines the page size |
| 8096 | Else numentries <<= PAGE_SHIFT determines the page size - scale |
| 8102 | WARN_ON(!(flags & Allocating during early boot? )) |
| 8103 | If Not (numentries >> _hash_shift) Then |
| 8104 | numentries = 1UL << _hash_shift |
| 8105 | BUG_ON(!numentries) |
| 8107 | Else if Value for the false possibility is greater at compile time((numentries * bucketsize) < PAGE_SIZE) Then numentries = PAGE_SIZE / bucketsize |
| 8113 | If max == 0 Then |
| 8114 | max = nr_all_pages << PAGE_SHIFT determines the page size >> 4 |
| 8117 | max = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(max, 0x80000000ULL) |
| 8119 | If numentries < low_limit Then numentries = low_limit |
| 8121 | If numentries > max Then numentries = max |
| 8127 | Do |
| 8128 | virt = false |
| 8129 | size = bucketsize << log2qty |
| 8130 | If flags & Allocating during early boot? Then |
| 8131 | If flags & Zero allocated hash table Then table = memblock_alloc(size, SMP_CACHE_BYTES) |
| 8133 | Else table = memblock_alloc_raw(size, SMP_CACHE_BYTES) |
| 8139 | Else |
| 8146 | kmemleak_alloc(table, size, 1, gfp_flags) |
| 8150 | If Not table Then panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
| 8153 | pr_info("%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 | If _hash_shift Then _hash_shift = log2qty |
| 8159 | If _hash_mask Then _hash_mask = (1 << log2qty) - 1 |
| 8162 | Return table |
| Name | Describe |
|---|---|
| dcache_init | |
| inode_init_early | Initialize the waitqueues and inode hash table. |
| inode_init | |
| mnt_init | |
| futex_init |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |