函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bfq_init_queue

函数原型:static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)

返回类型:int

参数:

类型参数名称
struct request_queue *q
struct elevator_type *e
6426  eq等于elevator_alloc(q, e)
6427  如果非eq则返回:负ENOMEM
6430  bfqd等于根据内存节点分配内存
6431  如果非bfqd
6432  递减引用计数对象
6433  返回:负ENOMEM
6435  elevator_data等于bfqd
6437  spin_lock_irq( & queue_lock)
6438  elevator等于eq
6439  spin_unlock_irq( & queue_lock)
6446  bfq_init_bfqq(bfqd, & fallback dummy bfqq for extreme OOM conditions , NULL, 1, 0)
6447  ce counter 自加
6448  xt ioprio and ioprio class if a change is in progress 等于BFQ_DEFAULT_QUEUE_IOPRIO
6449  xt ioprio and ioprio class if a change is in progress 等于IOPRIO_CLASS_BE
6450  next weight if a change is in progress 等于bfq_ioprio_to_weight(xt ioprio and ioprio class if a change is in progress )
6454  bfq_clear_bfqq_just_created( & fallback dummy bfqq for extreme OOM conditions )
6461  flag, set to request a weight, ioprio or ioprio_class change 等于1
6463  device request queue 等于q
6465  初始化链表头
6467  hrtimer_init - initialize a timer to the given clock*@timer: the timer to be initialized*@clock_id: the clock to be used*@mode: The modes which are relevant for intitialization:* HRTIMER_MODE_ABS, HRTIMER_MODE_REL, HRTIMER_MODE_ABS_SOFT,*
6469  function等于Handler of the expiration of the timer running if the in-service queue* is idling inside its time slice.
6471  * rbtree of weight counters of @bfq_queues, sorted by * weight. Used to keep track of whether all @bfq_queues have * the same weight. The tree contains one counter for each * distinct weight associated to some active and not * weight-raised @bfq_queue (see =
6472  * Number of groups with at least one descendant process that * has at least one request waiting for completion. Note that * this accounts for also requests already dispatched, but not * yet completed. Therefore this number of groups may differ * (be larger等于0
6474  初始化链表头
6475  初始化链表头
6476  INIT_HLIST_HEAD( & * Head of the burst list (as for the above fields, more * details in the comments on the function bfq_handle_burst).)
6478  flag set to one if the driver is showing a queueing behavior 等于负1
6479  true if the device is non rotational and performs queueing 等于blk_queue_nonrot( device request queue )
6481  maximum budget allotted to a bfq_queue before rescheduling 等于Default maximum budget values, in sectors and number of requests.
6483  * Timeout for async/sync requests; when it fires, requests * are served in fifo order.[0]等于Expiration time of sync (0) and async (1) requests, in ns. [0]
6484  * Timeout for async/sync requests; when it fires, requests * are served in fifo order.[1]等于Expiration time of sync (0) and async (1) requests, in ns. [1]
6485  maximum allowed backward seek 等于Maximum backwards seek (magic number lifted from CFQ), in KiB.
6486  weight of backward seeks wrt forward ones 等于Penalty of a backwards seek, in number of sectors.
6487  maximum idling time 等于Idling period duration, in ns.
6488  * Timeout for bfq_queues to consume their budget; used to * prevent seeky queues from imposing long latencies to * sequential or quasi-sequential ones (this also implies that * seeky queues cannot receive guarantees in the service * domain; after a timeout等于Default timeout values, in jiffies, approximating CFQ defaults.
6490  * Number of consecutive requests that must be issued within * the idle time slice to set again idling to a queue which * was marked as non-I/O-bound (see the definition of the * IO_bound flag for further details).等于120
6492  Maximum burst size above which the current queue-activation * burst is deemed as 'large'.等于8
6493  * Reference time interval used to decide whether a queue has * been activated shortly after @last_ins_in_burst.等于msecs_to_jiffies: - convert milliseconds to jiffies*@m: time in milliseconds* conversion is done as follows:* - negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET)* - 'too large' values [that would result in larger than
6495  if set to true, low-latency heuristics are enabled = true
6500  * Maximum factor by which the weight of a weight-raised queue * is multiplied.等于30
6501  Maximum weight-raising duration for soft real-time processes 等于msecs_to_jiffies: - convert milliseconds to jiffies*@m: time in milliseconds* conversion is done as follows:* - negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET)* - 'too large' values [that would result in larger than
6502  maximum duration of a weight-raising period (jiffies) 等于0
6503  * Minimum idle period after which weight-raising may be * reactivated for a queue (in jiffies).等于msecs_to_jiffies: - convert milliseconds to jiffies*@m: time in milliseconds* conversion is done as follows:* - negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET)* - 'too large' values [that would result in larger than
6504  * Minimum period between request arrivals after which * weight-raising may be reactivated for an already busy async * queue (in jiffies).等于msecs_to_jiffies: - convert milliseconds to jiffies*@m: time in milliseconds* conversion is done as follows:* - negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET)* - 'too large' values [that would result in larger than
6510  Max service-rate for a soft real-time queue, in sectors/sec 等于7000
6511  number of weight-raised busy @bfq_queues 等于0
6517  * Cached value of the product ref_rate*ref_wr_duration, used * for computing the maximum duration of weight raising * automatically.等于When configured for computing the duration of the weight-raising* for interactive queues automatically (see the comments at the* beginning of this file), BFQ does it using the following formula:* duration = (ref_rate / r) * ref_wr_duration,* where r is [blk_queue_nonrot( device request queue )]乘To improve readability, a conversion function is used to initialize* the following array, which entails that the array can be* initialized only in a function.[blk_queue_nonrot( device request queue )]
6519  * Current estimate of the device peak rate, measured in * [(sectors/usec) / 2^BFQ_RATE_SHIFT]. The left-shift by * BFQ_RATE_SHIFT is performed to increase precision in * fixed-point calculations.等于When configured for computing the duration of the weight-raising* for interactive queues automatically (see the comments at the* beginning of this file), BFQ does it using the following formula:* duration = (ref_rate / r) * ref_wr_duration,* where r is [blk_queue_nonrot( device request queue )]乘2除3
6521  spin_lock_init( & lock)
6538  root bfq_group for the device 等于bfq_create_group_hierarchy(bfqd, node)
6539  如果非 root bfq_group for the device 则转到:out_free
6541  bfq_init_root_group( root bfq_group for the device , bfqd)
6542  bfq_init_entity( & ity representing this queue in the scheduler , root bfq_group for the device )
6544  wbt_disable_default(q)
6545  返回:0
6547  out_free :
6548  释放内存
6549  递减引用计数对象
6550  返回:负ENOMEM