Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static void bfq_update_peak_rate(struct bfq_data *bfqd, struct request *rq)

Type:void

Parameter:

TypeParameterName
struct bfq_data *bfqd
struct request *rq
3180  now_ns = ktime_get_ns()
3182  If number of samples in current observation interval == 0 Then
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  Go to update_last_values
3201  If 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 Then Go to update_rate_and_reset
3206  number of samples in current observation interval ++
3208  If ( 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. ) && Not BFQ_RQ_SEEKY(bfqd, on-disk position of the last served request , rq) Then 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  If Value is more likely to compile time( number of samples in current observation interval % 32) Then 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  Else 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  If time elapsed from first dispatch in current observ. interval (us) < Target observation time interval for a peak-rate update (ns) Then Go to 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  If RQ_BFQQ(rq) == bfq_queue in service Then 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
Caller
NameDescribe
bfq_dispatch_removeRemove request from internal lists.