函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bfq-iosched.c Create Date:2022-07-27 19:31:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Update the read/write peak rate (the main quantity used for* auto-tuning, see update_thr_responsiveness_params())

函数原型:static void bfq_update_peak_rate(struct bfq_data *bfqd, struct request *rq)

返回类型:void

参数:

类型参数名称
struct bfq_data *bfqd
struct request *rq
3180  now_ns等于ktime_get_ns()
3182  如果 number of samples in current observation interval 恒等于0则
3183  bfq_log(bfqd, "update_peak_rate: goto reset, samples %d", number of samples in current observation interval )
3185  bfq_reset_rate_computation(bfqd, rq)
3186  转到:update_last_values
3201  如果now_ns time of last rq dispatch in current observation interval (ns) 大于100乘NSEC_PER_MSEC number of requests dispatched and waiting for completion 恒等于0则转到:update_rate_and_reset
3206  number of samples in current observation interval 自加
3208  如果 number of requests dispatched and waiting for completion 大于0或now_ns time of last request completion (ns) 小于Below this threshold (in ns), we consider thinktime immediate. 的值且非BFQ_RQ_SEEKY(bfqd, on-disk position of the last served request , rq)则 num of samples of seq dispatches in current observation interval 自加
3213  total num of sectors transferred in current observation interval 加等于blk_rq_sectors(rq)
3216  如果此条件成立可能性大(为编译器优化)( number of samples in current observation interval % 32)则 max rq size seen during current observation interval (sectors) 等于max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, blk_rq_sectors(rq), max rq size seen during current observation interval (sectors) )
3219  否则 max rq size seen during current observation interval (sectors) 等于blk_rq_sectors(rq)
3222  time elapsed from first dispatch in current observ. interval (us) 等于now_ns time of first rq dispatch in current observation interval (ns)
3225  如果 time elapsed from first dispatch in current observ. interval (us) 小于Target observation time interval for a peak-rate update (ns) 则转到:update_last_values
3228  update_rate_and_reset :
3229  bfq_update_rate_reset(bfqd, rq)
3230  update_last_values :
3231  on-disk position of the last served request 等于lk_rq_pos() : the current sector* blk_rq_bytes() : bytes left in the entire request* blk_rq_cur_bytes() : bytes left in the current segment* blk_rq_err_bytes() : bytes left till the next error boundary* blk_rq_sectors() : sectors left in the entire blk_rq_sectors(rq)
3232  如果RQ_BFQQ(rq)恒等于 bfq_queue in service position of the last served request for the in-service queue 等于 on-disk position of the last served request
3234  time of last rq dispatch in current observation interval (ns) 等于now_ns
调用者
名称描述
bfq_dispatch_removeRemove request from internal lists.