函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Merge de-allocated chunk of VA memory with previous* and next free blocks. If coalesce is not done a new* free area is inserted. If VA has been merged, it is* freed.

函数原型:static __always_inline struct vmap_area *merge_or_add_vmap_area(struct vmap_area *va, struct rb_root *root, struct list_head *head)

返回类型:struct vmap_area

参数:

类型参数名称
struct vmap_area *va
struct rb_root *root
struct list_head *head
694  bool merged = false
700  link等于This function returns back addresses of parent node* and its left or right link for further processing.
705  next等于get_va_next_sibling(parent, link)
706  如果此条件成立可能性小(为编译器优化)(next == NULL)则转到:insert
716  如果next不等于head
717  sibling等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(next, structvmap_area, list)
718  如果va_start恒等于va_end
719  va_start等于va_start
728  va等于sibling
729  merged = true
740  如果链表前项不等于head
741  sibling等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(链表前项, structvmap_area, list)
742  如果va_end恒等于va_start
743  va_end等于va_end
748  如果mergedunlink_va(va, root)
755  va等于sibling
756  merged = true
760  insert :
761  如果非merged
762  link_va(va, root, parent, link, head)
763  This function populates subtree_max_size from bottom to upper* levels starting from VA point
766  返回:va
调用者
名称描述
free_vmap_areaFree a region of KVA allocated by alloc_vmap_area
__purge_vmap_area_lazyPurges all lazily-freed vmap areas.