Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:iocg_activate

Proto:static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now)

Type:bool

Parameter:

TypeParameterName
struct ioc_gq *iocg
struct ioc_now *now
1029  ioc = ioc
1038  If Not list_empty - tests whether a list is empty*@head: the list to test. Then
1039  ake a snapshot of the current [v]time and vrate
1040  cur_period = atomic64_read( & c'd each period )
1041  If atomic64_read( & * The period this iocg was last active in. Used for deactivation * and invalidating `vtime`.) != cur_period Then atomic64_set( & * The period this iocg was last active in. Used for deactivation * and invalidating `vtime`., cur_period)
1043  Return true
1047  If see __propagate_active_weight() and current_hweight() for details Then Return false
1050  spin_lock_irq( & lock)
1052  ake a snapshot of the current [v]time and vrate
1055  cur_period = atomic64_read( & c'd each period )
1056  last_period = atomic64_read( & * The period this iocg was last active in. Used for deactivation * and invalidating `vtime`.)
1057  atomic64_set( & * The period this iocg was last active in. Used for deactivation * and invalidating `vtime`., cur_period)
1060  If Not list_empty - tests whether a list is empty*@head: the list to test. Then Go to succeed_unlock
1062  When i > 0 cycle If Not list_empty - tests whether a list is empty*@head: the list to test. Then
1064  Go to fail_unlock
1066  If see __propagate_active_weight() and current_hweight() for details Then Go to fail_unlock
1075  max_period_delta = DIV64_U64_ROUND_UP(VTIME_VALID_DUR, period_us)
1076  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 )
1077  vmargin = margin_us * vrate
1078  vmin = vnow - vmargin
1080  If last_period + max_period_delta < cur_period || time_before64(vtime, vmin) Then
1082  atomic64_add(vmin - vtime, & * `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 )
1083  atomic64_add(vmin - vtime, & done_vtime)
1084  vtime = vmin
1092  hweight_gen = atomic_read( & r lazy hweights ) - 1
1093  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1094  propagate_active_weight(iocg, weight, last_inuse ? : weight)
1097  TRACE_IOCG_PATH(iocg_activate, iocg, now, last_period, cur_period, vtime)
1100  last_vtime = vtime
1102  If running == IOC_IDLE Then
1103  running = IOC_RUNNING
1104  ioc_start_period(ioc, now)
1107  succeed_unlock :
1108  spin_unlock_irq( & lock)
1109  Return true
1111  fail_unlock :
1112  spin_unlock_irq( & lock)
1113  Return false
Caller
NameDescribe
ioc_rqos_throttle