Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-28 17:09:43
Last Modify:2020-03-17 23:18:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Returns true if we did some work AND can potentially do more.

Proto:bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, bool got_budget)

Type:bool

Parameter:

TypeParameterName
struct request_queue *q
struct list_head *list
boolgot_budget
1181  bool no_tag = false
1183  ret = BLK_STS_OK
1185  If list_empty - tests whether a list is empty*@head: the list to test. Then Return false
1188  WARN_ON(!list_is_singular - tests whether a list has just one entry.*@head: the list to test. && got_budget)
1193  errors = queued = 0
1194  Do
1197  rq = list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.(list, structrequest, queuelist)
1199  hctx = mq_hctx
1200  If Not got_budget && Not blk_mq_get_dispatch_budget(hctx) Then Break
1203  If Not blk_mq_get_driver_tag(rq) Then
1223  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
1225  rq = rq
1231  If list_empty - tests whether a list is empty*@head: the list to test. Then last = true
1233  Else
1238  ret = queue_rq(hctx, & bd)
1251  Break
1255  errors++
1257  Continue
1260  queued++
1261  When Not list_empty - tests whether a list is empty*@head: the list to test. cycle
1263  @dispatched: Number of dispatch requests by queue. [queued_to_index(queued)]++
1269  If Not list_empty - tests whether a list is empty*@head: the list to test. Then
1277  If commit_rqs Then commit_rqs(hctx)
1280  spin_lock( & @lock: Protects the dispatch list. )
1281  list_splice_init - join two lists and reinitialise the emptied list.*@list: the new list to add.*@head: the place to add it in the first list.* The list at @list is reinitialised
1282  spin_unlock( & @lock: Protects the dispatch list. )
1308  needs_restart = blk_mq_sched_needs_restart(hctx)
1309  If Not needs_restart || no_tag && list_empty_careful - tests whether a list is empty and not being modified*@head: the list to test* Description:* tests whether a list is empty _and_ checks that no other CPU might be* in the process of modifying either member (next or prev)* NOTE: using Then blk_mq_run_hw_queue(hctx, true)
1312  Else if needs_restart && ret == BLK_STS_RESOURCE Then blk_mq_delay_run_hw_queue(hctx, ms units )
1315  Update dispatch busy with the Exponential Weighted Moving Average(EWMA):* - EWMA is one simple way to compute running average value* - weight(7/8 and 1/8) is applied so that it can decrease exponentially* - take 4 as factor for avoiding to get too
1316  Return false
1317  Else Update dispatch busy with the Exponential Weighted Moving Average(EWMA):* - EWMA is one simple way to compute running average value* - weight(7/8 and 1/8) is applied so that it can decrease exponentially* - take 4 as factor for avoiding to get too
1324  If ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE is returned from the driver to the block layer if* device related resources are unavailable, but the driver can guarantee* that the queue will be rerun in the future once resources become* available again Then Return false
1327  Return queued + errors != 0
Caller
NameDescribe
blk_mq_do_dispatch_schedOnly SCSI implements .get_budget and .put_budget, and SCSI restarts* its queue by itself in its completion handler, so we don't need to* restart queue if .get_budget() returns BLK_STS_NO_RESOURCE.
blk_mq_do_dispatch_ctxOnly SCSI implements .get_budget and .put_budget, and SCSI restarts* its queue by itself in its completion handler, so we don't need to* restart queue if .get_budget() returns BLK_STS_NO_RESOURCE.
blk_mq_sched_dispatch_requests