Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Select a queue for service. If we have a current queue in service,* check whether to continue servicing it, or retrieve and set a new one.

Proto:static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)

Type:struct bfq_queue

Parameter:

TypeParameterName
struct bfq_data *bfqd
4340  reason = udget took too long to be used
4342  bfqq = bfq_queue in service
4343  If Not bfqq Then Go to new_queue
4346  bfq_log_bfqq(bfqd, bfqq, "select_queue: already in-service queue")
4355  If If we expire a queue that is actively waiting (i.e., with the* device idled) for the arrival of a new request, then we may incur* the timestamp misalignment problem described in the body of the* function __bfq_activate_entity && Not If the in-service queue is empty but the function bfq_better_to_idle* returns true, then:* 1) the queue must remain in service and cannot be expired, and* 2) the device must be idled to wait for the possible arrival of a new* request for the queue Then Go to expire
4359  check_queue :
4366  next_rq = fifo isn't expired, next request to serve
4371  If next_rq Then
4381  Go to expire
4382  Else
4388  If bfq_bfqq_wait_request(bfqq) Then
4405  Go to keep_queue
4417  If bfq_bfqq_wait_request(bfqq) || umber of requests on the dispatch list or inside driver != 0 && For a queue that becomes empty, device idling is allowed only if* this function returns true for that queue Then
4419  struct bfq_queue * async_bfqq = Pointer to the bfq_io_cq owning the bfq_queue, set to %NULL* if the queue is shared. && array of two process queues, the sync and the async [0] && bfq_bfqq_busy( array of two process queues, the sync and the async [0]) && fifo isn't expired, next request to serve ? array of two process queues, the sync and the async [0] : NULL
4497  If async_bfqq && q_to_bic - convert iocontext queue structure to bfq_io_cq.*@icq: the iocontext queue. == Pointer to the bfq_io_cq owning the bfq_queue, set to %NULL* if the queue is shared. && see the definition of bfq_async_charge_factor for details <= bfq_bfqq_budget_left(async_bfqq) Then bfqq = array of two process queues, the sync and the async [0]
4502  Else if bfq_bfqq_has_waker(bfqq) && bfq_bfqq_busy(Pointer to the waker queue for this queue, i.e., to the* queue Q such that this queue happens to get new I/O right* after some I/O request of Q is completed. For details, see* the comments on the choice of the queue for injection in* bfq_select_queue().) && fifo isn't expired, next request to serve && see the definition of bfq_async_charge_factor for details <= bfq_bfqq_budget_left(Pointer to the waker queue for this queue, i.e., to the* queue Q such that this queue happens to get new I/O right* after some I/O request of Q is completed. For details, see* the comments on the choice of the queue for injection in* bfq_select_queue().) Then bfqq = Pointer to the waker queue for this queue, i.e., to the* queue Q such that this queue happens to get new I/O right* after some I/O request of Q is completed. For details, see* the comments on the choice of the queue for injection in* bfq_select_queue().
4510  Else if Not idling_boosts_thr_without_issues(bfqd, bfqq) && ( actor by which the weight of this queue is multiplied == 1 || number of weight-raised busy @bfq_queues > 1 || Not bfq_bfqq_has_short_ttime(bfqq) ) Then bfqq = This function chooses the queue from which to pick the next extra* I/O request to inject, if it finds a compatible queue
4514  Else bfqq = NULL
4517  Go to keep_queue
4520  reason = he queue has no more requests
4521  expire :
4522  q_bfqq_expire - expire a queue.*@bfqd: device owning the queue.*@bfqq: the queue to expire.*@compensate: if true, compensate for the time spent idling.*@reason: the reason causing the expiration.* If the process associated with bfqq does slow I/O (e
4523  new_queue :
4524  bfqq = Get and set a new queue for service.
4525  If bfqq Then
4526  bfq_log_bfqq(bfqd, bfqq, "select_queue: checking new queue")
4527  Go to check_queue
4529  keep_queue :
4530  If bfqq Then bfq_log_bfqq(bfqd, bfqq, "select_queue: returned this queue")
4532  Else bfq_log(bfqd, "select_queue: no queue returned")
4535  Return bfqq
Caller
NameDescribe
__bfq_dispatch_request