Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:iocg_kick_waitq

Proto:static void iocg_kick_waitq(struct ioc_gq *iocg, struct ioc_now *now)

Type:void

Parameter:

TypeParameterName
struct ioc_gq *iocg
struct ioc_now *now
1144  ioc = ioc
1145  struct iocg_wake_ctx ctx = {iocg = iocg}
1146  margin_ns = period_us * WAITQ_TIMER_MARGIN_PCT / 100 * NSEC_PER_USEC
1152  lockdep_assert_held( & lock)
1154  current_hweight(iocg, NULL, & hw_inuse)
1155  vbudget = vnow - 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 )
1158  abs_vdebt = atomic64_read( & abs_vdebt)
1159  vdebt = Scale @abs_cost to the inverse of @hw_inuse. The lower the hierarchical* weight, the more expensive each IO. Must round up.
1160  If vdebt && vbudget > 0 Then
1161  delta = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, vbudget, vdebt)
1162  abs_delta = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(The inverse of abs_cost_to_cost(). Must round up., abs_vdebt)
1165  atomic64_add(delta, & * `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 )
1166  atomic64_add(delta, & done_vtime)
1167  atomic64_sub(abs_delta, & abs_vdebt)
1168  If WARN_ON_ONCE(atomic64_read( & abs_vdebt) < 0) Then atomic64_set( & abs_vdebt, 0)
1176  hw_inuse = hw_inuse
1177  vbudget = vbudget - vdebt
1178  __wake_up_locked_key( & waitq, Convenience macros for the sake of wake_up(): , & ctx)
1179  If Not waitqueue_active -- locklessly test for waiters on the queue*@wq_head: the waitqueue to test for waiters* returns true if the wait list is not empty* NOTE: this function is lockless and requires care, incorrect usage _will_ Then Return
1181  If WARN_ON_ONCE(vbudget >= 0) Then Return
1185  vshortage = -vbudget
1186  expires = now_ns + DIV64_U64_ROUND_UP(vshortage, vrate) * NSEC_PER_USEC
1188  expires += margin_ns / 4
1191  oexpires = Convert ktime_t to nanoseconds
1192  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
1196  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
Caller
NameDescribe
iocg_waitq_timer_fn
ioc_timer_fn
ioc_rqos_throttle