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

Commit d1b6f871 authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

msm-core: Activate ptable only on userspace power update



The power numbers calculated for cpus during probe are the same between
different cpus. This might cause the scheduler to incorrectly place
little tasks on big cpus and vice versa. Wait until the userspace
updates the device specific power numbers and then update the ptable to
reflect the non-overlapping power numbers between the clusters.

Change-Id: Icecda836d474d30a61118b1c5f4ebe6f3509a312
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 9f25a3ef
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -196,10 +196,11 @@ static int msm_core_ptable_read(struct seq_file *m, void *data)
			cpu, node->enabled == 1 ? "Enabled" : "Written");
			print_table(m, node->head, node->len);
		}
		if (node->driver_data) {
		if (msm_core_data[cpu].ptable) {
			seq_printf(m, "--- CPU%d - Live numbers at %ldC---\n",
			cpu, node->ptr->temp);
			print_table(m, node->driver_data, node->driver_len);
			print_table(m, msm_core_data[cpu].ptable,
					msm_core_data[cpu].len);
		}
	}
	return 0;
+7 −5
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ module_param_named(polling_interval, poll_ms, int,
static int disabled;
module_param_named(disabled, disabled, int,
		S_IRUGO | S_IWUSR | S_IWGRP);

static bool activate_power_table;
/*
 * Cannot be called from an interrupt context
 */
@@ -206,6 +208,7 @@ void trigger_cpu_pwr_stats_calc(void)
			sensor_get_temp(cpu_node->sensor_id, &cpu_node->temp);
		prev_temp[cpu] = cpu_node->temp;

		if (activate_power_table)
			repopulate_stats(cpu);
	}
	spin_unlock(&update_lock);
@@ -335,11 +338,12 @@ static int update_userspace_power(struct sched_params __user *argp)
				cpumask_clear_cpu(cpu, &clear_sp->mask);
				clear_static_power(clear_sp);
			}
			cpu_stats[cpu].ptable = per_cpu(ptable, cpu);
			repopulate_stats(cpu);
		}
	}

	for_each_possible_cpu(cpu)
		repopulate_stats(cpu);
	activate_power_table = true;
	return 0;

failed:
@@ -456,8 +460,6 @@ static int msm_core_stats_init(struct device *dev)
			pstate[i].freq = cpu_node->sp->table[i].frequency;

		per_cpu(ptable, cpu) = pstate;
		cpu_stats[cpu].ptable = per_cpu(ptable, cpu);
		repopulate_stats(cpu);
	}
	return 0;
}