Unverified Commit b1a48e24 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 4fef07bf 3d1c1055
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2047,7 +2047,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) {
@@ -2109,10 +2109,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);