Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmalloc.c Create Date:2022-07-28 14:58:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static __always_inline struct vmap_area *merge_or_add_vmap_area(struct vmap_area *va, struct rb_root *root, struct list_head *head)

Type:struct vmap_area

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(next == NULL) Then Go to insert
716  If next != head Then
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  If va_start == va_end Then
719  va_start = va_start
728  va = sibling
729  merged = true
740  If prev != head Then
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.(prev, structvmap_area, list)
742  If va_end == va_start Then
743  va_end = va_end
748  If merged Then unlink_va(va, root)
755  va = sibling
756  merged = true
760  insert :
761  If Not merged Then
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  Return va
Caller
NameDescribe
free_vmap_areaFree a region of KVA allocated by alloc_vmap_area
__purge_vmap_area_lazyPurges all lazily-freed vmap areas.