Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-28 17:10:47
Last Modify:2020-03-17 23:18:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:blk_mq_alloc_rqs

Proto:int blk_mq_alloc_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, unsigned int hctx_idx, unsigned int depth)

Type:int

Parameter:

TypeParameterName
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  If node == NUMA_NO_NODE Then node = numa_node
2123  Initialization list head
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_size * depth
2133  When i < depth cycle
2134  this_order = max_order
2139  When this_order && left < order_to_size(this_order - 1) cycle
2140  this_order--
2142  Do
2146  If page Then Break
2148  If Not this_order -- Then Break
2150  If order_to_size(this_order) < rq_size Then Break
2152  When 1 cycle
2154  If Not page Then Go to fail
2157  *@private: Mapping-private opaque data. * Usually used for buffer_heads if PagePrivate. * Used for swp_entry_t if PageSwapCache. * Indicates order in the buddy system if PageBuddy. = this_order
2158  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
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 = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(entries_per_page, depth - i)
2168  left -= to_do * rq_size
2169  When j < to_do cycle
2170  rq = p
2172  static_rqs[i] = rq
2173  If blk_mq_init_request(set, rq, hctx_idx, node) Then
2174  static_rqs[i] = NULL
2175  Go to fail
2178  p += rq_size
2179  i++
2182  Return 0
2184  fail :
2185  blk_mq_free_rqs(set, tags, hctx_idx)
2186  Return -ENOMEM
Caller
NameDescribe
__blk_mq_alloc_rq_map
blk_mq_tag_update_depth
blk_mq_sched_alloc_tags