Lines Matching +full:cpu +full:- +full:capacity
15 #include <linux/cpu.h>
29 #include <asm/cpu.h>
34 * cpu capacity scale management
38 * cpu capacity table
39 * This per cpu data structure describes the relative capacity of each core.
40 * On a heteregenous system, cores don't have the same computation capacity
42 * can take this difference into account during load balance. A per cpu
43 * structure is preferred because each CPU updates its own cpu_capacity field
61 * is used to compute the capacity of a CPU.
66 {"arm,cortex-a15", 3891},
67 {"arm,cortex-a7", 2048},
72 #define cpu_capacity(cpu) __cpu_capacity[cpu] argument
80 * as close as possible to (max{eff_i} - min{eff_i}) / 2
82 * 'average' CPU is of middle capacity. Also see the comments near
91 unsigned long capacity = 0; in parse_dt_topology() local
92 int cpu = 0; in parse_dt_topology() local
97 for_each_possible_cpu(cpu) { in parse_dt_topology()
101 /* too early to use cpu->of_node */ in parse_dt_topology()
102 cn = of_get_cpu_node(cpu, NULL); in parse_dt_topology()
104 pr_err("missing device node for CPU %d\n", cpu); in parse_dt_topology()
108 if (topology_parse_cpu_capacity(cn, cpu)) { in parse_dt_topology()
115 for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++) in parse_dt_topology()
116 if (of_device_is_compatible(cn, cpu_eff->compatible)) in parse_dt_topology()
119 if (cpu_eff->compatible == NULL) in parse_dt_topology()
122 rate = of_get_property(cn, "clock-frequency", &len); in parse_dt_topology()
124 pr_err("%pOF missing clock-frequency property\n", cn); in parse_dt_topology()
128 capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency; in parse_dt_topology()
130 /* Save min capacity of the system */ in parse_dt_topology()
131 if (capacity < min_capacity) in parse_dt_topology()
132 min_capacity = capacity; in parse_dt_topology()
134 /* Save max capacity of the system */ in parse_dt_topology()
135 if (capacity > max_capacity) in parse_dt_topology()
136 max_capacity = capacity; in parse_dt_topology()
138 cpu_capacity(cpu) = capacity; in parse_dt_topology()
142 * cpu_scale because all CPUs have the same capacity. Otherwise, we in parse_dt_topology()
143 * compute a middle_capacity factor that will ensure that the capacity in parse_dt_topology()
144 * of an 'average' CPU of the system will be as close as possible to in parse_dt_topology()
153 >> (SCHED_CAPACITY_SHIFT-1)) + 1; in parse_dt_topology()
160 * Look for a customed capacity of a CPU in the cpu_capacity table during the
164 static void update_cpu_capacity(unsigned int cpu) in update_cpu_capacity() argument
166 if (!cpu_capacity(cpu) || cap_from_dt) in update_cpu_capacity()
169 topology_set_cpu_scale(cpu, cpu_capacity(cpu) / middle_capacity); in update_cpu_capacity()
171 pr_info("CPU%u: update cpu_capacity %lu\n", in update_cpu_capacity()
172 cpu, topology_get_cpu_scale(cpu)); in update_cpu_capacity()
181 * store_cpu_topology is called at boot when only one cpu is running
190 if (cpuid_topo->package_id != -1) in store_cpu_topology()
195 /* create cpu topology mapping */ in store_cpu_topology()
204 cpuid_topo->thread_id = MPIDR_AFFINITY_LEVEL(mpidr, 0); in store_cpu_topology()
205 cpuid_topo->core_id = MPIDR_AFFINITY_LEVEL(mpidr, 1); in store_cpu_topology()
206 cpuid_topo->package_id = MPIDR_AFFINITY_LEVEL(mpidr, 2); in store_cpu_topology()
209 cpuid_topo->thread_id = -1; in store_cpu_topology()
210 cpuid_topo->core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0); in store_cpu_topology()
211 cpuid_topo->package_id = MPIDR_AFFINITY_LEVEL(mpidr, 1); in store_cpu_topology()
219 cpuid_topo->thread_id = -1; in store_cpu_topology()
220 cpuid_topo->core_id = 0; in store_cpu_topology()
221 cpuid_topo->package_id = -1; in store_cpu_topology()
226 pr_info("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", in store_cpu_topology()
236 * init_cpu_topology is called at boot when only one cpu is running