Lines Matching refs:cpu_data

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