函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blk_mq_make_request

函数原型:static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)

返回类型:blk_qc_t

参数:

类型参数名称
struct request_queue *q
struct bio *bio
1910  is_sync等于Reads are always treated as synchronous, as are requests with the FUA or* PREFLUSH flag. Other operations may be marked as synchronous using the* REQ_SYNC flag.
1911  is_flush_fua等于Check if the bio or request is one that needs special treatment in the* flush state machine.
1912  struct blk_mq_alloc_data data = {flags = 0}
1915  struct request * same_queue_rq = NULL
1919  blk_queue_bounce(q, & bio)
1920  __blk_queue_split - split a bio and submit the second half*@q: [in] request queue pointer*@bio: [in, out] bio to be split*@nr_segs: [out] number of segments in the first bio* Split a bio into two bios, chain the two bios, submit the second half and
1922  如果非_integrity_prep - Prepare bio for integrity I/O*@bio: bio to prepare* Description: Checks if the bio already has an integrity payload attached.* If it does, the payload has been generated by another kernel subsystem,* and we just pass it through则返回:BLK_QC_T_NONE
1925  如果非is_flush_fua且非blk_queue_nomerges(q)且lk_attempt_plug_merge - try to merge with %current's plugged list*@q: request_queue new bio is being queued at*@bio: new bio being queued*@nr_segs: number of segments in @bio*@same_queue_rq: pointer to &struct request that gets filled in when* another 则返回:BLK_QC_T_NONE
1929  如果blk_mq_sched_bio_merge(q, bio, nr_segs)则返回:BLK_QC_T_NONE
1932  rq_qos_throttle(q, bio)
1934  cmd_flags等于 bottom bits req flags, * top bits REQ_OP. Use * accessors.
1935  rq等于blk_mq_get_request(q, bio, & data)
1936  如果此条件成立可能性小(为编译器优化)(!rq)则
1937  rq_qos_cleanup(q, bio)
1938  如果 bottom bits req flags, * top bits REQ_OP. Use * accessors.按位与REQ_NOWAITbio_wouldblock_error(bio)
1940  返回:BLK_QC_T_NONE
1943  lock_getrq - get a free request entry in queue for block IO operations*@q: queue for operations*@bio: pending block IO operation (can be %NULL)*@rw: low bit indicates a read (%0) or a write (%1)* A request struct for queue @q has been allocated to handle
1945  rq_qos_track(q, rq, bio)
1947  cookie等于request_to_qc_t(hctx, rq)
1949  blk_mq_bio_to_request(rq, bio, nr_segs)
1951  plug等于lk_mq_plug() - Get caller context plug*@q: request queue*@bio : the bio being submitted by the caller context* Plugging, by design, may delay the insertion of BIOs into the elevator in* order to increase BIO merging opportunities
1952  如果此条件成立可能性小(为编译器优化)(is_flush_fua)则
1954  lk_insert_flush - insert a new PREFLUSH/FUA request*@rq: request to insert* To be called from __elv_add_request() for %ELEVATOR_INSERT_FLUSH insertions.* or __blk_mq_run_hw_queue() to dispatch request.*@rq is being submitted
1955  blk_mq_run_hw_queue(hctx, true)
1956  否则如果plugnr_hw_queues恒等于1或commit_rqs或非blk_queue_nonrot(q)的值则
1965  request_count等于rq_count
1966  struct request * last = NULL
1968  如果非request_countlock_plug - keep operations requests in request queue*@q: request queue to plug* Plug the request queue @q. Do not allow block operation requests* to be sent to the device driver. Instead, accumulate requests in
1970  否则last等于list_entry_rq(链表前项)
1973  如果request_count大于等于BLK_MAX_REQUEST_COUNTlastblk_rq_bytes(last)大于等于BLK_PLUG_FLUSH_SIZE
1979  blk_add_rq_to_plug(plug, rq)
1980  否则如果elevator
1981  blk_mq_sched_insert_request(rq, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., true, true)
1982  否则如果plug且非blk_queue_nomerges(q)则
1990  如果链表为空same_queue_rq = NULL
1992  如果same_queue_rq
1994  rq_count自减
1996  blk_add_rq_to_plug(plug, rq)
1997  lock_plug - keep operations requests in request queue*@q: request queue to plug* Plug the request queue @q. Do not allow block operation requests* to be sent to the device driver. Instead, accumulate requests in
1999  如果same_queue_rq
2000  hctx等于mq_hctx
2005  否则如果nr_hw_queues大于1且is_sync或非@dispatch_busy: Number used by blk_mq_update_dispatch_busy() to* decide if the hw_queue is busy using Exponential Weighted Moving* Average algorithm.
2007  blk_mq_try_issue_directly(hctx, rq, & cookie)
2008  否则
2009  blk_mq_sched_insert_request(rq, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., true, true)
2012  返回:cookie