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

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

parents 99e2fdd6 631ec7e3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -728,6 +728,12 @@ void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
	}

	stime = scale_stime(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:
	/*