Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:deadline_dispatch_requests selects the best request according to* read/write expire, fifo_batch, etc

Proto:static struct request *__dd_dispatch_request(struct deadline_data *dd)

Type:struct request

Parameter:

TypeParameterName
struct deadline_data *dd
277  If Not list_empty - tests whether a list is empty*@head: the list to test. Then
278  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.( & dispatch, structrequest, queuelist)
279  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
280  Go to done
283  reads = Not list_empty - tests whether a list is empty*@head: the list to test.
284  writes = Not list_empty - tests whether a list is empty*@head: the list to test.
289  rq = For the specified data direction, return the next request to* dispatch using sector position sorted lists.
290  If Not rq Then rq = For the specified data direction, return the next request to* dispatch using sector position sorted lists.
293  If rq && number of sequential requests made < fifo_batch Then Go to dispatch_request
302  If reads Then
303  BUG_ON(RB_EMPTY_ROOT( & * requests (deadline_rq s) are present on both sort_list and fifo_list[generic data direction definitions ]))
305  If For the specified data direction, return the next request to* dispatch using arrival ordered lists. && times reads have starved writes ++ >= writes_starved Then Go to dispatch_writes
309  data_dir = generic data direction definitions
311  Go to dispatch_find_request
318  If writes Then
319  dispatch_writes :
320  BUG_ON(RB_EMPTY_ROOT( & * requests (deadline_rq s) are present on both sort_list and fifo_list[WRITE]))
322  times reads have starved writes = 0
324  data_dir = WRITE
326  Go to dispatch_find_request
329  Return NULL
331  dispatch_find_request :
335  next_rq = For the specified data direction, return the next request to* dispatch using sector position sorted lists.
336  If deadline_check_fifo returns 0 if there are no expired requests on the fifo,* 1 otherwise. Requires !list_empty(&dd->fifo_list[data_dir]) || Not next_rq Then
342  rq = For the specified data direction, return the next request to* dispatch using arrival ordered lists.
343  Else
348  rq = next_rq
355  If Not rq Then Return NULL
358  number of sequential requests made = 0
360  dispatch_request :
364  number of sequential requests made ++
365  move an entry to dispatch queue
366  done :
370  blk_req_zone_write_lock(rq)
371  rq_flags |= drive already may have started this one
372  Return rq
Caller
NameDescribe
dd_dispatch_requestOne confusing aspect here is that we get called for a specific* hardware queue, but we may return a request that is for a* different hardware queue. This is because mq-deadline has shared* state for all hardware queues, in terms of sorting, FIFOs, etc.