函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Find the first free block(lowest start address) in the tree,* that will accomplish the request corresponding to passing* parameters.

函数原型:static __always_inline struct vmap_area *find_vmap_lowest_match(unsigned long size, unsigned long align, unsigned long vstart)

返回类型:struct vmap_area

参数:

类型参数名称
unsigned longsize
unsigned longalign
unsigned longvstart
802  node等于rb_node
805  length等于sizealign减1
807 node循环
808  va等于rb_entry(node, structvmap_area, rb_node)
810  如果get_subtree_max_size(rb_left)大于等于lengthvstart小于va_start
812  node等于rb_left
813  否则
814  如果is_within_this_va(va, size, align, vstart)则返回:va
822  如果get_subtree_max_size(rb_right)大于等于length
823  node等于rb_right
824  继续下一循环
832 node等于rb_parent(node)循环
833  va等于rb_entry(node, structvmap_area, rb_node)
834  如果is_within_this_va(va, size, align, vstart)则返回:va
837  如果get_subtree_max_size(rb_right)大于等于lengthvstart小于等于va_start
839  node等于rb_right
840  退出
846  返回:NULL
调用者
名称描述
__alloc_vmap_areaReturns a start address of the newly allocated area, if success.* Otherwise a vend is returned that indicates failure.