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

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

parents 4e6a3367 afa672a0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -579,6 +579,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:
	/*