Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bfq_init_queue

Proto:static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)

Type:int

Parameter:

TypeParameterName
struct request_queue *q
struct elevator_type *e
6426  eq = elevator_alloc(q, e)
6427  If Not eq Then Return -ENOMEM
6430  bfqd = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
6431  If Not bfqd Then
6432  kobject_put() - Decrement refcount for object.*@kobj: object.* Decrement the refcount, and if 0, call kobject_cleanup().
6433  Return -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  Initialization list head
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  Initialization list head
6475  Initialization list head
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  Process spin lock initialization( & lock)
6538  root bfq_group for the device = bfq_create_group_hierarchy(bfqd, node)
6539  If Not root bfq_group for the device Then Go to 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  Return 0
6547  out_free :
6548  kfree(bfqd)
6549  kobject_put() - Decrement refcount for object.*@kobj: object.* Decrement the refcount, and if 0, call kobject_cleanup().
6550  Return -ENOMEM