Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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 activityDownload SCCTChinese

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:

TypeParameterName
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  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().
8080  If PAGE_SHIFT determines the page size < 20 Then 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  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
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
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  If max == 0 Then
8114  max = nr_all_pages << PAGE_SHIFT determines the page size >> 4
8115  do_div() is NOT a C function(max, bucketsize)
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
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 = If flags & Zero allocated hash table Then 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 Else 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  Do
8128  virt = false
8129  size = bucketsize << log2qty
8138  virt = true
8139  Else
8148  When Not table && size > PAGE_SIZE && --log2qty cycle
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
Caller
NameDescribe
dcache_init
inode_init_earlyInitialize the waitqueues and inode hash table.
inode_init
mnt_init
futex_init