Unverified Commit 024f170b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 7936c422 f15e9bda
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2038,7 +2038,7 @@ static void ioc_forgive_debts(struct ioc *ioc, u64 usage_us_sum, int nr_debtors,
			      struct ioc_now *now)
{
	struct ioc_gq *iocg;
	u64 dur, usage_pct, nr_cycles;
	u64 dur, usage_pct, nr_cycles, nr_cycles_shift;

	/* if no debtor, reset the cycle */
	if (!nr_debtors) {
@@ -2100,10 +2100,12 @@ static void ioc_forgive_debts(struct ioc *ioc, u64 usage_us_sum, int nr_debtors,
		old_debt = iocg->abs_vdebt;
		old_delay = iocg->delay;

		nr_cycles_shift = min_t(u64, nr_cycles, BITS_PER_LONG - 1);
		if (iocg->abs_vdebt)
			iocg->abs_vdebt = iocg->abs_vdebt >> nr_cycles ?: 1;
			iocg->abs_vdebt = iocg->abs_vdebt >> nr_cycles_shift ?: 1;

		if (iocg->delay)
			iocg->delay = iocg->delay >> nr_cycles ?: 1;
			iocg->delay = iocg->delay >> nr_cycles_shift ?: 1;

		iocg_kick_waitq(iocg, true, now);