Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2a21ce1 authored by Srivatsa Vaddagiri's avatar Srivatsa Vaddagiri Committed by Steve Muckle
Browse files

sched: window-stats: Fix incorrect calculation of partial_demand



When using MAX_POLICY, partial_demand is calculated incorrectly as 0.
Fix this by picking maximum of previous 4 windows and most recent
sample.

Change-Id: I27850a510746a63b5382c84761920fc021b876c5
Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@codeaurora.org>
parent 5c351b80
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1145,9 +1145,14 @@ update_history(struct rq *rq, struct task_struct *p, u32 runtime, int samples,
		return;

	if (!new_window) {
		for (ridx = 0; ridx < RAVG_HIST_SIZE - 1; ++ridx)
		for (ridx = 0; ridx < RAVG_HIST_SIZE - 1; ++ridx) {
			sum += hist[ridx];
			if (hist[ridx] > max)
				max = hist[ridx];
		}
		sum += runtime;
		if (runtime > max)
			max = runtime;
		goto compute_demand;
	}