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,
72 static int hd_high_capacity_cores; /* Current CORE count with high capacity */
76 static unsigned long hd_previous_steal; /* Previous iteration's CPU steal timer total */
77 static unsigned long hd_high_time; /* Total time spent while all cpus have high capacity */
78 static unsigned long hd_low_time; /* Total time spent while vl cpus have low capacity */
106 void hd_add_core(int cpu) in hd_add_core() argument
112 polarization = smp_cpu_get_polarization(cpu); in hd_add_core()
113 siblings = topology_sibling_cpumask(cpu); in hd_add_core()
123 cpumask_set_cpu(cpu, &hd_vl_coremask); in hd_add_core()
158 int cpu, upscaling_cores; in hd_update_capacities() local
159 unsigned long capacity; in hd_update_capacities() local
161 upscaling_cores = hd_high_capacity_cores - hd_entitled_cores; in hd_update_capacities()
162 capacity = upscaling_cores > 0 ? CPU_CAPACITY_HIGH : CPU_CAPACITY_LOW; in hd_update_capacities()
164 for_each_cpu(cpu, &hd_vl_coremask) { in hd_update_capacities()
165 smp_set_core_capacity(cpu, capacity); in hd_update_capacities()
166 if (capacity != CPU_CAPACITY_HIGH) in hd_update_capacities()
169 upscaling_cores--; in hd_update_capacities()
171 capacity = CPU_CAPACITY_LOW; in hd_update_capacities()
202 steal = (steal * (HD_STEAL_AVG_WEIGHT - 1) + new) / HD_STEAL_AVG_WEIGHT; in hd_steal_avg()
210 int cpus, cpu; in hd_calculate_steal_percentage() local
216 for_each_cpu(cpu, &hd_vmvl_cpumask) { in hd_calculate_steal_percentage()
217 steal += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL]; in hd_calculate_steal_percentage()
229 steal_delta = (steal - hd_previous_steal) * 100 / time_delta; in hd_calculate_steal_percentage()
246 * Normally this check is handled on topology update, but during cpu in hd_capacity_work_fn()
247 * unhotplug, topology and cpu mask updates are done in reverse in hd_capacity_work_fn()
277 .procname = ctl->procname, in hiperdispatch_ctl_handler()
322 return -ERANGE; in hd_steal_threshold_store()
348 return -ERANGE; in hd_delay_factor_store()
413 if (sysfs_create_group(&dev->kobj, &hd_attr_group)) in hd_create_attributes()