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

Commit 09657429 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpuidle: lpm-levels: Enable ipi prediction"

parents f03998e3 02d07ab8
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ struct lpm_cluster *lpm_root_node;
static bool lpm_prediction = true;
module_param_named(lpm_prediction, lpm_prediction, bool, 0664);

static bool lpm_ipi_prediction;
static bool lpm_ipi_prediction = true;
module_param_named(lpm_ipi_prediction, lpm_ipi_prediction, bool, 0664);

struct lpm_history {
@@ -469,9 +469,6 @@ static uint64_t find_deviation(int *interval, uint32_t ref_stddev,
	uint64_t max, avg, stddev;
	int64_t thresh = LLONG_MAX;

	if (lpm_ipi_prediction)
		ref_stddev += DEFAULT_IPI_STDDEV;

	do {
		max = avg = divisor = stddev = 0;
		for (i = 0; i < MAXSAMPLES; i++) {
@@ -601,7 +598,8 @@ static uint64_t lpm_cpuidle_predict(struct cpuidle_device *dev,
	if (*idx_restrict_time || !cpu->ipi_prediction || !lpm_ipi_prediction)
		return 0;

	avg = find_deviation(ipi_history->interval, cpu->ref_stddev,
	avg = find_deviation(ipi_history->interval, cpu->ref_stddev
						+ DEFAULT_IPI_STDDEV,
						&(history->stime));
	if (avg) {
		*ipi_predicted = 1;