函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:w_vmap_block - allocates new vmap_block and occupies 2^order pages in this* block

函数原型:static void *new_vmap_block(unsigned int order, gfp_t gfp_mask)

返回类型:void

参数:

类型参数名称
unsigned intorder
gfp_tgfp_mask
1499  node等于Returns the number of the current Node.
1501  vb等于kmalloc_node(sizeof(structvmap_block), gfp_mask & The set of flags that only affect watermark checking and reclaim* behaviour. This is used by the MM to obey the caller constraints* about IO, FS and watermark checking while ignoring placement* hints such as HIGHMEM usage., node)
1503  如果此条件成立可能性小(为编译器优化)(!vb)则返回:错误号
1506  va等于Allocate a region of KVA of the specified size and alignment, within the* vstart and vend.
1509  如果是错误
1510  释放内存
1511  返回:错误指示
1514  err等于Load up this CPU's radix_tree_node buffer with sufficient objects to* ensure that the addition of a single element in the tree cannot fail
1515  如果此条件成立可能性小(为编译器优化)(err)则
1516  释放内存
1517  Free a region of KVA allocated by alloc_vmap_area
1518  返回:错误号
1521  vaddr等于vmap_block_vaddr(va_start, 0)
1522  spin_lock_init( & lock)
1523  va等于va
1525  BUG_ON(VMAP_BBMAP_BITS <= (1UL << order))
1526  free等于VMAP_BBMAP_BITS减1UL左移order位的值
1527  dirty等于0
1528  dirty_min等于VMAP_BBMAP_BITS
1529  < dirty range 等于0
1530  初始化链表头
1532  vb_idx等于We should probably have a fallback mechanism to allocate virtual memory* out of partially filled vmap blocks. However vmap block sizing should be* fairly reasonable according to the vmalloc size, so it shouldn't be a* big problem.
1533  加自旋锁
1534  err等于在radix树中插入节点
1535  自旋锁解锁
1536  BUG_ON(err)
1537  radix_tree_preload_end()
1539  vbq等于Must be an lvalue. Since @var must be a simple identifier,* we force a syntax error here if it isn't.(Queue of free and dirty vmap blocks, for allocation and flushing purposes )
1540  加自旋锁
1541  添加RCU链表项
1542  自旋锁解锁
1543  The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(Queue of free and dirty vmap blocks, for allocation and flushing purposes )
1545  返回:vaddr
调用者
名称描述
vb_alloc