函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bfq-iosched.c Create Date:2022-07-27 19:30:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq, struct rb_root_cached *root)

返回类型:void

参数:

类型参数名称
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  如果pointer to the weight counter associated with this entity 则返回
744 new循环
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  转到:inc_counter
754  如果 weight of the queue 小于weight of the queues this counter refers to new等于rb_left的地址
756  否则
757  new等于rb_right的地址
758  leftmost = false
762  pointer to the weight counter associated with this entity 等于分配内存并置零
777  如果此条件成立可能性小(为编译器优化)(!pointer to the weight counter associated with this entity )则返回
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 自加
调用者
名称描述
__bfq_entity_update_weight_prioUpdate weight and priority of entity
bfq_add_bfqq_busyCalled when an inactive queue receives a new request.