• Home
  • Raw
  • Download

Lines Matching refs:now

560 	u64				now;  member
946 static void ioc_refresh_vrate(struct ioc *ioc, struct ioc_now *now) in ioc_refresh_vrate() argument
948 s64 pleft = ioc->period_at + ioc->period_us - now->now; in ioc_refresh_vrate()
977 static void ioc_now(struct ioc *ioc, struct ioc_now *now) in ioc_now() argument
981 now->now_ns = ktime_get(); in ioc_now()
982 now->now = ktime_to_us(now->now_ns); in ioc_now()
983 now->vrate = atomic64_read(&ioc->vtime_rate); in ioc_now()
995 now->vnow = ioc->period_at_vtime + in ioc_now()
996 (now->now - ioc->period_at) * now->vrate; in ioc_now()
1000 static void ioc_start_period(struct ioc *ioc, struct ioc_now *now) in ioc_start_period() argument
1005 ioc->period_at = now->now; in ioc_start_period()
1006 ioc->period_at_vtime = now->vnow; in ioc_start_period()
1019 bool save, struct ioc_now *now) in __propagate_weights() argument
1040 iocg->saved_margin = now->vnow - atomic64_read(&iocg->vtime); in __propagate_weights()
1094 bool save, struct ioc_now *now) in propagate_weights() argument
1096 __propagate_weights(iocg, active, inuse, save, now); in propagate_weights()
1180 static void weight_updated(struct ioc_gq *iocg, struct ioc_now *now) in weight_updated() argument
1191 propagate_weights(iocg, weight, iocg->inuse, true, now); in weight_updated()
1195 static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now) in iocg_activate() argument
1207 ioc_now(ioc, now); in iocg_activate()
1220 ioc_now(ioc, now); in iocg_activate()
1241 vtarget = now->vnow - ioc->margins.target; in iocg_activate()
1257 iocg->last_inuse ?: iocg->weight, true, now); in iocg_activate()
1259 TRACE_IOCG_PATH(iocg_activate, iocg, now, in iocg_activate()
1262 iocg->activated_at = now->now; in iocg_activate()
1266 ioc->dfgv_period_at = now->now; in iocg_activate()
1268 ioc_start_period(ioc, now); in iocg_activate()
1280 static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now) in iocg_kick_delay() argument
1291 tdelta = now->now - iocg->delay_at; in iocg_kick_delay()
1300 abs_cost_to_cost(iocg->abs_vdebt, hwa) - now->vnow; in iocg_kick_delay()
1317 iocg->delay_at = now->now; in iocg_kick_delay()
1323 iocg->indelay_since = now->now; in iocg_kick_delay()
1328 iocg->local_stat.indelay_us += now->now - iocg->indelay_since; in iocg_kick_delay()
1338 struct ioc_now *now) in iocg_incur_debt() argument
1351 iocg->indebt_since = now->now; in iocg_incur_debt()
1352 propagate_weights(iocg, iocg->active, 0, false, now); in iocg_incur_debt()
1363 struct ioc_now *now) in iocg_pay_debt() argument
1376 iocg->local_stat.indebt_us += now->now - iocg->indebt_since; in iocg_pay_debt()
1380 false, now); in iocg_pay_debt()
1417 struct ioc_now *now) in iocg_kick_waitq() argument
1428 vbudget = now->vnow - atomic64_read(&iocg->vtime); in iocg_kick_waitq()
1440 iocg_pay_debt(iocg, abs_vpay, now); in iocg_kick_waitq()
1445 iocg_kick_delay(iocg, now); in iocg_kick_waitq()
1470 iocg->local_stat.wait_us += now->now - iocg->wait_since; in iocg_kick_waitq()
1477 iocg->wait_since = now->now; in iocg_kick_waitq()
1484 expires = now->now_ns + in iocg_kick_waitq()
1503 struct ioc_now now; in iocg_waitq_timer_fn() local
1506 ioc_now(iocg->ioc, &now); in iocg_waitq_timer_fn()
1509 iocg_kick_waitq(iocg, pay_debt, &now); in iocg_waitq_timer_fn()
1599 static void iocg_flush_stat_one(struct ioc_gq *iocg, struct ioc_now *now) in iocg_flush_stat_one() argument
1649 static void iocg_flush_stat(struct list_head *target_iocgs, struct ioc_now *now) in iocg_flush_stat() argument
1656 iocg_flush_stat_one(iocg, now); in iocg_flush_stat()
1662 iocg_flush_stat_one(iocg, now); in iocg_flush_stat()
1673 u32 usage, struct ioc_now *now) in hweight_after_donation() argument
1685 time_after64(vtime, now->vnow - ioc->margins.min)) in hweight_after_donation()
1689 excess = now->vnow - vtime - ioc->margins.target; in hweight_after_donation()
1713 delta = div64_s64(WEIGHT_ONE * (now->vnow - vtime), in hweight_after_donation()
1714 now->vnow - ioc->period_at_vtime); in hweight_after_donation()
1778 static void transfer_surpluses(struct list_head *surpluses, struct ioc_now *now) in transfer_surpluses() argument
1980 TRACE_IOCG_PATH(inuse_transfer, iocg, now, in transfer_surpluses()
1985 __propagate_weights(iocg, iocg->active, inuse, true, now); in transfer_surpluses()
2005 struct ioc_now *now) in ioc_forgive_debts() argument
2012 ioc->dfgv_period_at = now->now; in ioc_forgive_debts()
2028 if (time_before64(now->now, ioc->dfgv_period_at + DFGV_PERIOD)) in ioc_forgive_debts()
2035 dur = now->now - ioc->dfgv_period_at; in ioc_forgive_debts()
2038 ioc->dfgv_period_at = now->now; in ioc_forgive_debts()
2075 iocg_kick_waitq(iocg, true, now); in ioc_forgive_debts()
2077 TRACE_IOCG_PATH(iocg_forgive_debt, iocg, now, usage_pct, in ioc_forgive_debts()
2089 struct ioc_now now; in ioc_timer_fn() local
2105 ioc_now(ioc, &now); in ioc_timer_fn()
2107 period_vtime = now.vnow - ioc->period_at_vtime; in ioc_timer_fn()
2128 iocg->local_stat.wait_us += now.now - iocg->wait_since; in ioc_timer_fn()
2129 iocg->wait_since = now.now; in ioc_timer_fn()
2133 now.now - iocg->indebt_since; in ioc_timer_fn()
2134 iocg->indebt_since = now.now; in ioc_timer_fn()
2138 now.now - iocg->indelay_since; in ioc_timer_fn()
2139 iocg->indelay_since = now.now; in ioc_timer_fn()
2145 iocg_kick_waitq(iocg, true, &now); in ioc_timer_fn()
2159 excess = now.vnow - vtime - ioc->margins.target; in ioc_timer_fn()
2168 __propagate_weights(iocg, 0, 0, false, &now); in ioc_timer_fn()
2180 iocg_flush_stat(&ioc->active_iocgs, &now); in ioc_timer_fn()
2204 time_after64(vtime, now.vnow - in ioc_timer_fn()
2206 time_before64(vdone, now.vnow - period_vtime)) in ioc_timer_fn()
2225 usage_dur = max_t(u64, now.now - iocg->activated_at, 1); in ioc_timer_fn()
2227 usage_dur = max_t(u64, now.now - ioc->period_at, 1); in ioc_timer_fn()
2238 time_before64(vtime, now.vnow - ioc->margins.low))) { in ioc_timer_fn()
2248 usage, &now); in ioc_timer_fn()
2271 TRACE_IOCG_PATH(inuse_shortage, iocg, &now, in ioc_timer_fn()
2276 iocg->active, true, &now); in ioc_timer_fn()
2286 transfer_surpluses(&surpluses, &now); in ioc_timer_fn()
2388 ioc_forgive_debts(ioc, usage_us_sum, nr_debtors, &now); in ioc_timer_fn()
2398 ioc_start_period(ioc, &now); in ioc_timer_fn()
2405 ioc_refresh_vrate(ioc, &now); in ioc_timer_fn()
2412 u64 abs_cost, struct ioc_now *now) in adjust_inuse_and_calc_cost() argument
2424 margin = now->vnow - vtime - cost; in adjust_inuse_and_calc_cost()
2457 propagate_weights(iocg, iocg->active, new_inuse, true, now); in adjust_inuse_and_calc_cost()
2460 } while (time_after64(vtime + cost, now->vnow) && in adjust_inuse_and_calc_cost()
2465 TRACE_IOCG_PATH(inuse_adjust, iocg, now, in adjust_inuse_and_calc_cost()
2550 struct ioc_now now; in ioc_rqos_throttle() local
2565 if (!iocg_activate(iocg, &now)) in ioc_rqos_throttle()
2570 cost = adjust_inuse_and_calc_cost(iocg, vtime, abs_cost, &now); in ioc_rqos_throttle()
2578 time_before_eq64(vtime + cost, now.vnow)) { in ioc_rqos_throttle()
2626 iocg_incur_debt(iocg, abs_cost, &now); in ioc_rqos_throttle()
2627 if (iocg_kick_delay(iocg, &now)) in ioc_rqos_throttle()
2642 &now); in ioc_rqos_throttle()
2665 iocg_kick_waitq(iocg, ioc_locked, &now); in ioc_rqos_throttle()
2686 struct ioc_now now; in ioc_rqos_merge() local
2698 ioc_now(ioc, &now); in ioc_rqos_merge()
2701 cost = adjust_inuse_and_calc_cost(iocg, vtime, abs_cost, &now); in ioc_rqos_merge()
2713 time_before_eq64(atomic64_read(&iocg->vtime) + cost, now.vnow)) { in ioc_rqos_merge()
2727 iocg_incur_debt(iocg, abs_cost, &now); in ioc_rqos_merge()
2728 if (iocg_kick_delay(iocg, &now)) in ioc_rqos_merge()
2926 struct ioc_now now; in ioc_pd_init() local
2930 ioc_now(ioc, &now); in ioc_pd_init()
2933 atomic64_set(&iocg->vtime, now.vnow); in ioc_pd_init()
2934 atomic64_set(&iocg->done_vtime, now.vnow); in ioc_pd_init()
2954 weight_updated(iocg, &now); in ioc_pd_init()
2968 struct ioc_now now; in ioc_pd_free() local
2970 ioc_now(ioc, &now); in ioc_pd_free()
2971 propagate_weights(iocg, 0, 0, false, &now); in ioc_pd_free()
3045 struct ioc_now now; in ioc_weight_write() local
3066 ioc_now(iocg->ioc, &now); in ioc_weight_write()
3067 weight_updated(iocg, &now); in ioc_weight_write()
3093 ioc_now(iocg->ioc, &now); in ioc_weight_write()
3094 weight_updated(iocg, &now); in ioc_weight_write()