Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bfq-iosched.c Create Date:2022-07-28 17:54:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:If the weight-counter tree passed as input contains no counter for* the weight of the input queue, then add that counter; otherwise just* increment the existing counter.* Note that weight-counter trees contain few nodes in mostly symmetric* scenarios

Proto:void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq, struct rb_root_cached *root)

Type:void

Parameter:

TypeParameterName
struct bfq_data *bfqd
struct bfq_queue *bfqq
struct rb_root_cached *root
725  entity = ity representing this queue in the scheduler
726  struct rb_node * * new = & (rb_node), * parent = NULL
727  bool leftmost = true
741  If pointer to the weight counter associated with this entity Then Return
744  When new cycle
745  __counter = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.( * new, structbfq_weight_counter, weights_node)
748  parent = new
752  Go to inc_counter
754  If weight of the queue < weight of the queues this counter refers to Then new = &rb_left
756  Else
757  new = &rb_right
758  leftmost = false
762  pointer to the weight counter associated with this entity = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
777  If Value for the false possibility is greater at compile time(!pointer to the weight counter associated with this entity ) Then Return
780  weight of the queues this counter refers to = weight of the queue
781  rb_link_node( & Weights tree member (see bfq_data's @queue_weights_tree), parent, new)
782  rb_insert_color_cached( & Weights tree member (see bfq_data's @queue_weights_tree), root, leftmost)
785  inc_counter :
786  r of active queues with this weight ++
787  ce counter ++
Caller
NameDescribe
__bfq_entity_update_weight_prioUpdate weight and priority of entity
bfq_add_bfqq_busyCalled when an inactive queue receives a new request.