Lines Matching +full:cpu +full:- +full:capacity
1 // SPDX-License-Identifier: GPL-2.0
11 * Dynamically calculates the optimum number of high capacity COREs
13 * that a capacity update is necessary, it schedules a topology update.
14 * During topology updates the CPU capacities are always re-adjusted.
16 * There is two places where CPU capacities are being accessed within
18 * -> hiperdispatch's reoccuring work function reads CPU capacities to
19 * determine high capacity CPU count.
20 * -> during a topology update hiperdispatch's adjustment function
21 * updates CPU capacities.
33 * of them high capacity.
37 * - single CORE, with N threads, running N tasks
38 * - N separate COREs running N tasks,
73 static int hd_high_capacity_cores; /* Current CORE count with high capacity */
77 static unsigned long hd_previous_steal; /* Previous iteration's CPU steal timer total */
78 static unsigned long hd_high_time; /* Total time spent while all cpus have high capacity */
79 static unsigned long hd_low_time; /* Total time spent while vl cpus have low capacity */
107 void hd_add_core(int cpu)
113 polarization = smp_cpu_get_polarization(cpu);
114 siblings = topology_sibling_cpumask(cpu);
124 cpumask_set_cpu(cpu, &hd_vl_coremask);
159 int cpu, upscaling_cores;
160 unsigned long capacity;
162 upscaling_cores = hd_high_capacity_cores - hd_entitled_cores;
163 capacity = upscaling_cores > 0 ? CPU_CAPACITY_HIGH : CPU_CAPACITY_LOW;
165 for_each_cpu(cpu, &hd_vl_coremask) {
166 smp_set_core_capacity(cpu, capacity);
167 if (capacity != CPU_CAPACITY_HIGH)
170 upscaling_cores--;
172 capacity = CPU_CAPACITY_LOW;
203 steal = (steal * (HD_STEAL_AVG_WEIGHT - 1) + new) / HD_STEAL_AVG_WEIGHT;
211 int cpus, cpu;
217 for_each_cpu(cpu, &hd_vmvl_cpumask) {
218 steal += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL];
230 steal_delta = (steal - hd_previous_steal) * 100 / time_delta;
247 * Normally this check is handled on topology update, but during cpu
248 * unhotplug, topology and cpu mask updates are done in reverse
278 .procname = ctl->procname,
323 return -ERANGE;
349 return -ERANGE;
414 if (sysfs_create_group(&dev->kobj, &hd_attr_group))