函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmalloc.c Create Date:2022-07-27 16:28:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:adjust_va_to_fit_type

函数原型:static __always_inline int adjust_va_to_fit_type(struct vmap_area *va, unsigned long nva_start_addr, unsigned long size, enum fit_type type)

返回类型:int

参数:

类型参数名称
struct vmap_area *va
unsigned longnva_start_addr
unsigned longsize
enum fit_typetype
926  struct vmap_area * lva = NULL
928  如果type恒等于 full fit
936  unlink_va(va, & This augment red-black tree represents the free vmap space)
937  kmem_cache_free(This kmem_cache is used for vmap_area objects. Instead of* allocating from slab we reuse an object from this cache to* make things faster. Especially in "no edge" splitting of* free block., va)
938  否则如果type恒等于 left edge fit
946  va_start加等于size
947  否则如果type恒等于 right edge fit
955  va_end等于nva_start_addr
956  否则如果type恒等于NE_FIT_TYPE
964  lva等于__this_cpu_xchg(Preload a CPU with one object for "no edge" split case. The* aim is to get rid of allocations from the atomic context, thus* to use more permissive allocation masks., NULL)
992  如果非lva则返回:负1
999  va_start等于va_start
1000  va_end等于nva_start_addr
1005  va_start等于nva_start_addrsize
1006  否则
1007  返回:负1
1010  如果type不等于 full fit
1011  This function populates subtree_max_size from bottom to upper* levels starting from VA point
1013  如果lvainsert_vmap_area_augment(lva, & address sorted rbtree , & This augment red-black tree represents the free vmap space, & This linked list is used in pair with free_vmap_area_root.* It gives O(1) access to prev/next to perform fast coalescing.)
1018  返回:0
调用者
名称描述
__alloc_vmap_areaReturns a start address of the newly allocated area, if success.* Otherwise a vend is returned that indicates failure.