函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-27 18:45:04
Last Modify:2020-03-17 23:18:05 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Returns true if we did some work AND can potentially do more.

函数原型:bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, bool got_budget)

返回类型:bool

参数:

类型参数名称
struct request_queue *q
struct list_head *list
boolgot_budget
1181  bool no_tag = false
1183  ret等于BLK_STS_OK
1185  如果链表为空则返回:false
1188  WARN_ON(!链表只有一项 && got_budget)
1193  errors等于queued等于0
1194  循环
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  如果非got_budget且非blk_mq_get_dispatch_budget(hctx)则退出
1203  如果非blk_mq_get_driver_tag(rq)则
1223  删除链表项并重新初始化
1225  rq等于rq
1231  如果链表为空last = true
1233  否则
1235  last等于非blk_mq_get_driver_tag(nxt)
1238  ret等于queue_rq(hctx, & bd)
1245  如果非链表为空
1251  退出
1255  errors自加
1257  继续下一循环
1260  queued自加
1261  当非链表为空循环
1263  @dispatched: Number of dispatch requests by queue. [queued_to_index(queued)]自加
1269  如果非链表为空
1277  如果commit_rqscommit_rqs(hctx)
1280  加自旋锁
1281  加入二个链表项并重新初始化
1282  自旋锁解锁
1308  needs_restart等于blk_mq_sched_needs_restart(hctx)
1309  如果非needs_restartno_tag链表为空且不修改blk_mq_run_hw_queue(hctx, true)
1312  否则如果needs_restartret恒等于BLK_STS_RESOURCEblk_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  返回:false
1317  否则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  如果ret恒等于BLK_STS_RESOURCEret恒等于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则返回:false
1327  返回:queuederrors不等于0
调用者
名称描述
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