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

Commit ece15fe2 authored by Steve Muckle's avatar Steve Muckle
Browse files

Merge remote-tracking branch 'quic/tmp-hmp' into msm-3.10



Scheduler support for HMP CPU topologies and scheduler-driven
frequency selection.

Change-Id: I5dcda918fd56121111446e69d0f76122b96641c9
Signed-off-by: default avatarSteve Muckle <smuckle@codeaurora.org>
parents e77d5022 1aa9b699
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -52,6 +52,13 @@ static void set_power_scale(unsigned int cpu, unsigned long power)
	per_cpu(cpu_scale, cpu) = power;
}

static DEFINE_PER_CPU(unsigned long, cpu_efficiency) = SCHED_POWER_SCALE;

unsigned long arch_get_cpu_efficiency(int cpu)
{
	return per_cpu(cpu_efficiency, cpu);
}

#ifdef CONFIG_OF
struct cpu_efficiency {
	const char *compatible;
@@ -117,6 +124,8 @@ static void __init parse_dt_topology(void)
		if (cpu_eff->compatible == NULL)
			continue;

		per_cpu(cpu_efficiency, cpu) = cpu_eff->efficiency;

		rate = of_get_property(cn, "clock-frequency", &len);
		if (!rate || len != 4) {
			pr_err("%s missing clock-frequency property\n",
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_SCHED_HMP=y
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set
@@ -47,6 +48,7 @@ CONFIG_PM_WAKELOCKS_LIMIT=0
CONFIG_PM_RUNTIME=y
CONFIG_SUSPEND_TIME=y
CONFIG_CPU_FREQ=y
CONFIG_SCHED_FREQ_INPUT=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_SCHED_HMP=y
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set
@@ -47,6 +48,7 @@ CONFIG_PM_WAKELOCKS_LIMIT=0
CONFIG_PM_RUNTIME=y
CONFIG_SUSPEND_TIME=y
CONFIG_CPU_FREQ=y
CONFIG_SCHED_FREQ_INPUT=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+9 −0
Original line number Diff line number Diff line
@@ -212,6 +212,13 @@ static unsigned long *__cpu_capacity;

static unsigned long middle_capacity = 1;

static DEFINE_PER_CPU(unsigned long, cpu_efficiency) = SCHED_POWER_SCALE;

unsigned long arch_get_cpu_efficiency(int cpu)
{
	return per_cpu(cpu_efficiency, cpu);
}

/*
 * Iterate all CPUs' descriptor in DT and compute the efficiency
 * (as per table_efficiency). Also calculate a middle efficiency
@@ -295,6 +302,8 @@ static void __init parse_dt_cpu_power(void)
			continue;
		}

		per_cpu(cpu_efficiency, cpu) = cpu_eff->efficiency;

		rate = of_get_property(cn, "clock-frequency", &len);
		if (!rate || len != 4) {
			pr_err("%s: Missing clock-frequency property\n",
+10 −0
Original line number Diff line number Diff line
@@ -20,6 +20,16 @@ if CPU_FREQ
config CPU_FREQ_GOV_COMMON
	bool

config SCHED_FREQ_INPUT
	bool "Scheduler inputs to cpufreq governor"
	depends on SMP && FAIR_GROUP_SCHED
	help
	  This option enables support for scheduler based CPU utilization
	  calculations which may then be used by any cpufreq governor. The
	  scheduler keeps track of "recent" cpu demand of tasks, which can
	  help determine need for changing frequency well in advance of what
	  a governor would have been able to detect on its own.

config CPU_FREQ_STAT
	tristate "CPU frequency translation statistics"
	default y
Loading