函数逻辑报告 |
Source Code:mm\vmalloc.c |
Create Date:2022-07-27 16:28:39 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Allocate a region of KVA of the specified size and alignment, within the* vstart and vend.
函数原型: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)
返回类型:struct vmap_area
参数:
类型 | 参数 | 名称 |
---|---|---|
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 | 如果此条件成立可能性小(为编译器优化)(!vmap_initialized)则返回:错误号 |
1105 | might_sleep() |
1108 | va等于在指定节点上分配一个对象 |
1109 | 如果此条件成立可能性小(为编译器优化)(!va)则返回:错误号 |
1116 | kmemleak_scan_area( & address sorted rbtree , SIZE_MAX, gfp_mask) |
1118 | retry : |
1134 | pva = NULL |
1144 | 加自旋锁 |
1153 | addr等于Returns a start address of the newly allocated area, if success.* Otherwise a vend is returned that indicates failure. |
1154 | 自旋锁解锁 |
1156 | 如果此条件成立可能性小(为编译器优化)(addr == vend)则转到:overflow |
1161 | in "busy" tree = NULL |
1164 | 加自旋锁 |
1165 | insert_vmap_area(va, & vmap_area_root, & Export for kexec only ) |
1166 | 自旋锁解锁 |
1168 | BUG_ON(!IS_ALIGNED(va_start, align)) |
1172 | ret等于kasan_populate_vmalloc(addr, size) |
1173 | 如果ret则 |
1175 | 返回:错误号 |
1178 | 返回:va |
1180 | overflow : |
1181 | 如果非purged则 |
1187 | 如果gfpflags_allow_blocking(gfp_mask)则 |
1196 | 如果非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()则打印警告信息("vmap allocation for size %lu failed: use vmalloc=<size> to increase size\n", size) |
1201 | 返回:错误号 |
名称 | 描述 |
---|---|
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 |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |