Function report |
Source Code:mm\vmalloc.c |
Create Date:2022-07-28 14:58:59 |
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 region of KVA of the specified size and alignment, within the* vstart and vend.
Proto:static struct vmap_area *alloc_vmap_area(unsigned long size, unsigned long align, unsigned long vstart, unsigned long vend, int node, gfp_t gfp_mask)
Type:struct vmap_area
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned long | size | |
unsigned long | align | |
unsigned long | vstart | |
unsigned long | vend | |
int | node | |
gfp_t | gfp_mask |
1095 | purged = 0 |
1099 | BUG_ON(offset_in_page(size)) |
1102 | If Value for the false possibility is greater at compile time(!vmap_initialized) Then Return ERR_PTR( - EBUSY) |
1105 | might_sleep() |
1109 | If Value for the false possibility is greater at compile time(!va) Then Return ERR_PTR( - ENOMEM) |
1116 | kmemleak_scan_area( & address sorted rbtree , SIZE_MAX, gfp_mask) |
1118 | retry : |
1134 | pva = NULL |
1144 | spin_lock( & free_vmap_area_lock) |
1153 | addr = Returns a start address of the newly allocated area, if success.* Otherwise a vend is returned that indicates failure. |
1154 | spin_unlock( & free_vmap_area_lock) |
1156 | If Value for the false possibility is greater at compile time(addr == vend) Then Go to overflow |
1161 | in "busy" tree = NULL |
1164 | spin_lock( & vmap_area_lock) |
1165 | insert_vmap_area(va, & vmap_area_root, & Export for kexec only ) |
1166 | spin_unlock( & vmap_area_lock) |
1168 | BUG_ON(!IS_ALIGNED(va_start, align)) |
1172 | ret = kasan_populate_vmalloc(addr, size) |
1173 | If ret Then |
1178 | Return va |
1180 | overflow : |
1181 | If Not purged Then |
1187 | If gfpflags_allow_blocking(gfp_mask) Then |
1188 | freed = 0 |
1189 | blocking_notifier_call_chain( & vmap_notify_list, 0, & freed) |
1190 | If freed > 0 Then |
1196 | If Not (gfp_mask & DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.) && printk_ratelimit() Then pr_warn("vmap allocation for size %lu failed: use vmalloc=<size> to increase size\n", size) |
Name | Describe |
---|---|
new_vmap_block | w_vmap_block - allocates new vmap_block and occupies 2^order pages in this* block |
vm_map_ram | vm_map_ram - map pages linearly into kernel virtual address (vmalloc space)*@pages: an array of pointers to the pages to be mapped*@count: number of pages*@node: prefer to allocate data structures on this node*@prot: memory protection to use |
__get_vm_area_node |
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 |