Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:iocg_kick_delay

Proto:static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now, u64 cost)

Type:bool

Parameter:

TypeParameterName
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_us * vrate
1221  margin_ns = margin_us * NSEC_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  If time_before_eq64(vtime, vnow) Then
1231  blkcg_clear_delay(blkg)
1232  Return false
1234  If Not atomic_read( & use_delay) && time_before_eq64(vtime, vnow + vmargin) Then Return false
1239  If cost Then
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_ns + DIV64_U64_ROUND_UP(vtime - vnow, vrate) * NSEC_PER_USEC
1250  oexpires = Convert ktime_t to nanoseconds
1251  If 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 Then Return 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  Return true
Caller
NameDescribe
iocg_delay_timer_fn
ioc_timer_fn
ioc_rqos_throttle