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

Commit 54052c36 authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa
Browse files

sched/hmp: Remove capping when reporting load to the cpufreq governor



Capping load when reporting to the governor was important prior to new
scheduler guided frequency changes as intra-cluster migrations would
sometimes lead to CPU loads well in excess of 100%. With the new top
task approach however, load greater than 100% is no longer possible
except for the same conditions that were previously exempted (i.e.
inter-cluster migrations and frequency aggregation).

Change-Id: I3e4f5e39ec9ae7eeaba9a567efd245a7aec1b7ad
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent 85d7e134
Loading
Loading
Loading
Loading
+6 −30
Original line number Original line Diff line number Diff line
@@ -3296,7 +3296,7 @@ void sched_get_cpus_busy(struct sched_load *busy,
	u64 load[cpus], group_load[cpus];
	u64 load[cpus], group_load[cpus];
	u64 nload[cpus], ngload[cpus];
	u64 nload[cpus], ngload[cpus];
	u64 pload[cpus];
	u64 pload[cpus];
	unsigned int cur_freq[cpus], max_freq[cpus];
	unsigned int max_freq[cpus];
	int notifier_sent = 0;
	int notifier_sent = 0;
	int early_detection[cpus];
	int early_detection[cpus];
	int cpu, i = 0;
	int cpu, i = 0;
@@ -3336,7 +3336,6 @@ void sched_get_cpus_busy(struct sched_load *busy,


		update_task_ravg(rq->curr, rq, TASK_UPDATE, sched_ktime_clock(),
		update_task_ravg(rq->curr, rq, TASK_UPDATE, sched_ktime_clock(),
				 0);
				 0);
		cur_freq[i] = cpu_cycles_to_freq(rq->cc.cycles, rq->cc.time);


		account_load_subtractions(rq);
		account_load_subtractions(rq);
		load[i] = rq->old_busy_time = rq->prev_runnable_sum;
		load[i] = rq->old_busy_time = rq->prev_runnable_sum;
@@ -3360,7 +3359,6 @@ void sched_get_cpus_busy(struct sched_load *busy,
			rq->cluster->notifier_sent = 0;
			rq->cluster->notifier_sent = 0;
		}
		}
		early_detection[i] = (rq->ed_task != NULL);
		early_detection[i] = (rq->ed_task != NULL);
		cur_freq[i] = cpu_cur_freq(cpu);
		max_freq[i] = cpu_max_freq(cpu);
		max_freq[i] = cpu_max_freq(cpu);
		i++;
		i++;
	}
	}
@@ -3433,33 +3431,11 @@ skip_early:
			goto exit_early;
			goto exit_early;
		}
		}


		/*
		 * When the load aggregation is controlled by
		 * sched_freq_aggregate_threshold, allow reporting loads
		 * greater than 100 @ Fcur to ramp up the frequency
		 * faster.
		 */
		if (notifier_sent || (aggregate_load &&
					sched_freq_aggregate_threshold)) {
		load[i] = scale_load_to_freq(load[i], max_freq[i],
		load[i] = scale_load_to_freq(load[i], max_freq[i],
				cpu_max_possible_freq(cpu));
				cpu_max_possible_freq(cpu));
		nload[i] = scale_load_to_freq(nload[i], max_freq[i],
		nload[i] = scale_load_to_freq(nload[i], max_freq[i],
				cpu_max_possible_freq(cpu));
				cpu_max_possible_freq(cpu));
		} else {
			load[i] = scale_load_to_freq(load[i], max_freq[i],
						     cur_freq[i]);
			nload[i] = scale_load_to_freq(nload[i], max_freq[i],
						      cur_freq[i]);
			if (load[i] > window_size)
				load[i] = window_size;
			if (nload[i] > window_size)
				nload[i] = window_size;


			load[i] = scale_load_to_freq(load[i], cur_freq[i],
						    cpu_max_possible_freq(cpu));
			nload[i] = scale_load_to_freq(nload[i], cur_freq[i],
						    cpu_max_possible_freq(cpu));
		}
		pload[i] = scale_load_to_freq(pload[i], max_freq[i],
		pload[i] = scale_load_to_freq(pload[i], max_freq[i],
					     rq->cluster->max_possible_freq);
					     rq->cluster->max_possible_freq);