Lines Matching +full:always +full:- +full:turbo
1 // SPDX-License-Identifier: GPL-2.0-only
22 #include <asm/intel-family.h>
58 * Since the frequency freq_curr on x86 is controlled by micro-controller and
59 * our P-state setting is little more than a request/hint, we need to observe
65 * where freq_base is the max non-turbo P-state.
68 * can't know which turbo states will be available at a given point in time:
70 * the turbo level with 4 cores active.
72 * Benchmarks show that's a good compromise between the 1C turbo ratio
74 * which would ignore the entire turbo range (a conspicuous part, making
75 * freq_curr/freq_max always maxed out).
78 * highest turbo level for freq_max since Atom's are generally oriented towards
81 * Setting freq_max to anything less than the 1C turbo ratio makes the ratio
122 *turbo_freq = *turbo_freq & 0x3F; /* 1C turbo */ in slv_set_max_freq_ratio()
178 fratio -= delta_fratio; in knl_set_max_freq_ratio()
232 *turbo_freq = (msr >> 24) & 0xFF; /* 4C turbo */ in core_set_max_freq_ratio()
236 *turbo_freq = msr & 0xFF; /* 1C turbo */ in core_set_max_freq_ratio()
270 * Some CPUs have turbo boost but don't declare any turbo ratio in intel_set_max_freq_ratio()
274 …pr_debug("Couldn't determine cpu base or turbo frequency, necessary for scale-invariant accounting… in intel_set_max_freq_ratio()
280 pr_debug("Non-zero turbo and base frequencies led to a 0 ratio.\n"); in intel_set_max_freq_ratio()
362 * arch_enable_hybrid_capacity_scale() - Enable hybrid CPU capacity scaling
364 * Allocate memory for per-CPU data used by hybrid CPU capacity scaling,
383 per_cpu_ptr(arch_cpu_scale, cpu)->capacity = SCHED_CAPACITY_SCALE; in arch_enable_hybrid_capacity_scale()
384 per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio = arch_max_freq_ratio; in arch_enable_hybrid_capacity_scale()
395 * arch_set_cpu_capacity() - Set scale-invariance parameters for a CPU
398 * @max_cap: System-wide maximum CPU capacity.
407 * to let the scheduler know that capacity-aware scheduling can be used going
414 WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->capacity, in arch_set_cpu_capacity()
416 WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio, in arch_set_cpu_capacity()
426 return READ_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->capacity); in arch_scale_cpu_capacity()
443 freq_ratio = READ_ONCE(this_cpu_ptr(arch_cpu_scale)->freq_ratio); in scale_freq_tick()
479 acnt = aperf - s->aperf; in arch_scale_freq_tick()
480 mcnt = mperf - s->mperf; in arch_scale_freq_tick()
482 s->aperf = aperf; in arch_scale_freq_tick()
483 s->mperf = mperf; in arch_scale_freq_tick()
485 raw_write_seqcount_begin(&s->seq); in arch_scale_freq_tick()
486 s->last_update = jiffies; in arch_scale_freq_tick()
487 s->acnt = acnt; in arch_scale_freq_tick()
488 s->mcnt = mcnt; in arch_scale_freq_tick()
489 raw_write_seqcount_end(&s->seq); in arch_scale_freq_tick()
512 seq = raw_read_seqcount_begin(&s->seq); in arch_freq_get_on_cpu()
513 last = s->last_update; in arch_freq_get_on_cpu()
514 acnt = s->acnt; in arch_freq_get_on_cpu()
515 mcnt = s->mcnt; in arch_freq_get_on_cpu()
516 } while (read_seqcount_retry(&s->seq, seq)); in arch_freq_get_on_cpu()
522 if (!mcnt || (jiffies - last) > MAX_SAMPLE_AGE) in arch_freq_get_on_cpu()