Lines Matching refs:inuse
476 * `weight`. `inuse` is the surplus adjusted active weight.
477 * `active` and `inuse` are used to calculate `hweight_active` and
480 * `last_inuse` remembers `inuse` while an iocg is idle to persist
483 * `inuse` may be adjusted dynamically during period. `saved_*` are used
489 u32 inuse;
1023 * Update @iocg's `active` and `inuse` to @active and @inuse, update level
1025 * is saved to be used as reference for later inuse in-period adjustments.
1027 static void __propagate_weights(struct ioc_gq *iocg, u32 active, u32 inuse,
1036 * For an active leaf node, its inuse shouldn't be zero or exceed
1037 * @active. An active internal node's inuse is solely determined by the
1038 * inuse to active ratio of its children regardless of @inuse.
1041 inuse = DIV64_U64_ROUND_UP(active * iocg->child_inuse_sum,
1044 inuse = clamp_t(u32, inuse, 1, active);
1047 iocg->last_inuse = iocg->inuse;
1051 if (active == iocg->active && inuse == iocg->inuse)
1061 parent->child_inuse_sum += (s32)(inuse - child->inuse);
1064 child->inuse = inuse;
1067 * The delta between inuse and active sums indicates that
1068 * that much of weight is being given away. Parent's inuse
1080 parent_inuse == parent->inuse)
1084 inuse = parent_inuse;
1102 static void propagate_weights(struct ioc_gq *iocg, u32 active, u32 inuse,
1105 __propagate_weights(iocg, active, inuse, save, now);
1140 u32 inuse = READ_ONCE(child->inuse);
1149 inuse_sum = max_t(u64, inuse, inuse_sum);
1150 hwi = div64_u64((u64)hwi * inuse, inuse_sum);
1164 * Calculate the hweight_inuse @iocg would get with max @inuse assuming all the
1170 u32 inuse = iocg->active;
1180 child_inuse_sum = parent->child_inuse_sum + inuse - child->inuse;
1181 hwm = div64_u64((u64)hwm * inuse, child_inuse_sum);
1182 inuse = DIV64_U64_ROUND_UP(parent->active * child_inuse_sum,
1200 propagate_weights(iocg, weight, iocg->inuse, true, now);
1363 * Once in debt, debt handling owns inuse. @iocg stays at the minimum
1364 * inuse donating all of it share to others until its debt is paid off.
1386 WARN_ON_ONCE(iocg->inuse > 1);
1390 /* if debt is paid in full, restore inuse */
1695 /* debt handling owns inuse for debtors */
1740 * bumping up vrate accordingly 2. lowering the donating iocg's inuse weight.
1743 * global hweight_inuse updates when idle iocg's get activated or inuse weights
1755 * inuse should be adjusted to achieve the target donation amounts. This is done
1769 * achieved by scaling inuse weights of donating leaves and propagating the
1774 * Combining the above two, we can determine how each leaf iocg's inuse should
1928 * Calculate adjusted hwi, child_adjusted_sum and inuse for the inner
1933 u32 inuse, wpt, wptp;
1952 inuse = DIV64_U64_ROUND_UP(
1965 (u64)inuse * iocg->hweight_after_donation,
1977 u32 inuse;
1981 * the minimum target hweight_inuse. Configuring inuse
1983 * @iocg->inuse stay at the minimum and we don't wanna
1987 WARN_ON_ONCE(iocg->inuse > 1);
1992 inuse = DIV64_U64_ROUND_UP(
1997 iocg->inuse, inuse,
2001 __propagate_weights(iocg, iocg->active, inuse, true, now);
2279 * its inuse to active.
2281 * Don't reset debtors as their inuse's are
2288 iocg->inuse, iocg->active,
2432 u32 __maybe_unused old_inuse = iocg->inuse, __maybe_unused old_hwi;
2443 /* debt handling owns inuse for debtors */
2448 * We only increase inuse during period and do so iff the margin has
2452 iocg->inuse == iocg->active)
2457 /* we own inuse only when @iocg is in the normal active state */
2464 * Bump up inuse till @abs_cost fits in the existing budget.
2470 new_inuse = iocg->inuse;
2478 iocg->inuse != iocg->active);
2483 old_inuse, iocg->inuse, old_hwi, hwi);
2651 /* guarantee that iocgs w/ waiters have maximum inuse */
2652 if (!iocg->abs_vdebt && iocg->inuse != iocg->active) {