函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:iocg_kick_delay

函数原型:static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now, u64 cost)

返回类型:bool

参数:

类型参数名称
struct ioc_gq *iocg
struct ioc_now *now
u64cost
1217  ioc等于ioc
1218  blkg等于iocg_to_blkg(iocg)
1219  vtime等于atomic64_read( & * `vtime` is this iocg's vtime cursor which progresses as IOs are * issued. If lagging behind device vtime, the delta represents * the currently available IO budget. If runnning ahead, the * overage. * `vtime_done` is the same but progressed on completion )
1220  vmargin等于margin_usvrate
1221  margin_ns等于margin_usNSEC_PER_USEC
1226  current_hweight(iocg, NULL, & hw_inuse)
1227  vtime加等于Scale @abs_cost to the inverse of @hw_inuse. The lower the hierarchical* weight, the more expensive each IO. Must round up.
1230  如果time_before_eq64(vtime, vnow)则
1231  blkcg_clear_delay(blkg)
1232  返回:false
1234  如果非atomic_read( & use_delay)且time_before_eq64(vtime, vnow + vmargin)则返回:false
1239  如果cost
1240  cost_ns等于DIV64_U64_ROUND_UP(cost * NSEC_PER_USEC, vrate)
1242  lkcg_add_delay - add delay to this blkg*@blkg: blkg of interest*@now: the current time in nanoseconds*@delta: how many nanoseconds of delay to add* Charge @delta to the blkg's current delay accumulation. This is used to
1244  blkcg_use_delay(blkg)
1246  expires等于now_nsDIV64_U64_ROUND_UP(vtime - vnow, vrate)乘NSEC_PER_USEC
1250  oexpires等于Convert ktime_t to nanoseconds
1251  如果hrtimer_is_queued = check, whether the timer is on one of the queues*@timer: Timer to check* Returns: True if the timer is queued, false otherwise* The function can be used lockless, but it gives only a current snapshot.abs - return absolute value of an argument*@x: the value. If it is unsigned type, it is converted to signed type first.* char is treated as if it was signed (regardless of whether it really is)* but the macro's return type is preserved as char.(oexpires - expires)小于等于margin_ns除4则返回:true
1255  hrtimer_start_range_ns - (re)start an hrtimer*@timer: the timer to be added*@tim: expiry time*@delta_ns: "slack" range for the timer*@mode: timer mode: absolute (HRTIMER_MODE_ABS) or* relative (HRTIMER_MODE_REL), and pinned (HRTIMER_MODE_PINNED);* softirq
1257  返回:true
调用者
名称描述
iocg_delay_timer_fn
ioc_timer_fn
ioc_rqos_throttle