Lines Matching refs:cpu_data

209  * @cpu_data: Governor CPU data for the target CPU
212 static bool teo_cpu_is_utilized(int cpu, struct teo_cpu *cpu_data)
214 return sched_cpu_util(cpu) > cpu_data->util_threshold;
217 static bool teo_cpu_is_utilized(int cpu, struct teo_cpu *cpu_data)
230 struct teo_cpu *cpu_data = per_cpu_ptr(&teo_cpus, dev->cpu);
235 if (cpu_data->time_span_ns >= cpu_data->sleep_length_ns) {
265 cpu_data->total = 0;
273 struct teo_bin *bin = &cpu_data->state_bins[i];
278 cpu_data->total += bin->hits + bin->intercepts;
282 if (target_residency_ns <= cpu_data->sleep_length_ns) {
289 i = cpu_data->next_recent_idx++;
290 if (cpu_data->next_recent_idx >= NR_RECENT)
291 cpu_data->next_recent_idx = 0;
293 if (cpu_data->recent_idx[i] >= 0)
294 cpu_data->state_bins[cpu_data->recent_idx[i]].recent--;
303 cpu_data->tick_hits -= cpu_data->tick_hits >> DECAY_SHIFT;
305 cpu_data->total += cpu_data->tick_hits;
307 if (TICK_NSEC <= cpu_data->sleep_length_ns) {
310 cpu_data->tick_hits += PULSE;
323 cpu_data->state_bins[idx_timer].hits += PULSE;
324 cpu_data->recent_idx[i] = -1;
326 cpu_data->state_bins[idx_duration].intercepts += PULSE;
327 cpu_data->state_bins[idx_duration].recent++;
328 cpu_data->recent_idx[i] = idx_duration;
332 cpu_data->total += PULSE;
376 struct teo_cpu *cpu_data = per_cpu_ptr(&teo_cpus, dev->cpu);
398 cpu_data->time_span_ns = local_clock();
403 cpu_data->sleep_length_ns = KTIME_MAX;
414 cpu_utilized = teo_cpu_is_utilized(dev->cpu, cpu_data);
442 struct teo_bin *prev_bin = &cpu_data->state_bins[i-1];
486 cpu_data->state_bins[drv->state_count-1].intercepts;
497 alt_intercepts = 2 * idx_intercept_sum > cpu_data->total - idx_hit_sum;
515 struct teo_bin *bin = &cpu_data->state_bins[i];
592 cpu_data->sleep_length_ns = duration_ns;
610 tick_intercept_sum > cpu_data->total / 2 + cpu_data->total / 8)
644 struct teo_cpu *cpu_data = per_cpu_ptr(&teo_cpus, dev->cpu);
653 (tick_nohz_idle_got_tick() && cpu_data->sleep_length_ns > TICK_NSEC)) {
655 cpu_data->time_span_ns = cpu_data->sleep_length_ns;
657 cpu_data->time_span_ns = local_clock() - cpu_data->time_span_ns;
669 struct teo_cpu *cpu_data = per_cpu_ptr(&teo_cpus, dev->cpu);
673 memset(cpu_data, 0, sizeof(*cpu_data));
674 cpu_data->util_threshold = max_capacity >> UTIL_THRESHOLD_SHIFT;
677 cpu_data->recent_idx[i] = -1;