Unverified Commit dc3e4805 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10816 sched/cputime: Fix mul_u64_u64_div_u64() precision for cputime

parents df79d3bf d32aba64
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -595,6 +595,12 @@ void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
	}

	stime = mul_u64_u64_div_u64(stime, rtime, stime + utime);
	/*
	 * Because mul_u64_u64_div_u64() can approximate on some
	 * achitectures; enforce the constraint that: a*b/(b+c) <= a.
	 */
	if (unlikely(stime > rtime))
		stime = rtime;

update:
	/*