函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-27 18:46:09
Last Modify:2020-03-17 23:18:05 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:blk_mq_alloc_rqs

函数原型:int blk_mq_alloc_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, unsigned int hctx_idx, unsigned int depth)

返回类型:int

参数:

类型参数名称
struct blk_mq_tag_set *set
struct blk_mq_tags *tags
unsigned inthctx_idx
unsigned intdepth
2115  max_order等于4
2119  node等于CPU -> queue mappings
2120  如果node恒等于NUMA_NO_NODEnode等于numa_node
2123  初始化链表头
2129  rq_size等于und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(sizeof(structrequest) + cmd_size, cache_line_size())
2131  left等于rq_sizedepth
2133 i小于depth循环
2134  this_order等于max_order
2139 this_orderleft小于order_to_size(this_order - 1)循环
2140  this_order自减
2142  循环
2146  如果page退出
2148  如果非this_order自减则退出
2150  如果order_to_size(this_order)小于rq_size退出
2152  当1循环
2154  如果非page则转到:fail
2157  私有数据指针等于this_order
2158  添加链表项
2160  p等于page_address(page)
2165  kmemleak_alloc - register a newly allocated object*@ptr: pointer to beginning of the object*@size: size of the object*@min_count: minimum number of references to this object. If during memory* scanning a number of references less than @min_count is found,
2166  entries_per_page等于order_to_size(this_order)除rq_size
2167  to_do等于两数取小(entries_per_page, depth - i)
2168  left减等于to_dorq_size
2169 j小于to_do循环
2170  rq等于p
2172  static_rqs[i]等于rq
2173  如果blk_mq_init_request(set, rq, hctx_idx, node)则
2174  static_rqs[i] = NULL
2175  转到:fail
2178  p加等于rq_size
2179  i自加
2182  返回:0
2184  fail :
2185  blk_mq_free_rqs(set, tags, hctx_idx)
2186  返回:负ENOMEM
调用者
名称描述
__blk_mq_alloc_rq_map
blk_mq_tag_update_depth
blk_mq_sched_alloc_tags