linux/arch/x86
Rafael J. Wysocki 5a9d10145a x86/sched: Add basic support for CPU capacity scaling
In order be able to compute the sizes of tasks consistently across all
CPUs in a hybrid system, it is necessary to provide CPU capacity scaling
information to the scheduler via arch_scale_cpu_capacity().  Moreover,
the value returned by arch_scale_freq_capacity() for the given CPU must
correspond to the arch_scale_cpu_capacity() return value for it, or
utilization computations will be inaccurate.

Add support for it through per-CPU variables holding the capacity and
maximum-to-base frequency ratio (times SCHED_CAPACITY_SCALE) that will
be returned by arch_scale_cpu_capacity() and used by scale_freq_tick()
to compute arch_freq_scale for the current CPU, respectively.

In order to avoid adding measurable overhead for non-hybrid x86 systems,
which are the vast majority in the field, whether or not the new hybrid
CPU capacity scaling will be in effect is controlled by a static key.
This static key is set by calling arch_enable_hybrid_capacity_scale()
which also allocates memory for the per-CPU data and initializes it.
Next, arch_set_cpu_capacity() is used to set the per-CPU variables
mentioned above for each CPU and arch_rebuild_sched_domains() needs
to be called for the scheduler to realize that capacity-aware
scheduling can be used going forward.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Tested-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> # scale invariance
Link: https://patch.msgid.link/10523497.nUPlyArG6x@rjwysocki.net
[ rjw: Added parens to function kerneldoc comments ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-09-04 13:36:40 +02:00
..
boot Kbuild updates for v6.11 2024-07-23 14:32:21 -07:00
coco x86/sev: Fix __reserved field in sev_config 2024-07-30 10:07:26 +02:00
configs hardening: Enable KCFI and some other options 2024-05-01 12:38:14 -07:00
crypto crypto: x86/aes-gcm - rewrite the AES-NI optimized AES-GCM 2024-06-07 19:47:58 +08:00
entry uretprobe: change syscall number, again 2024-08-02 15:18:49 +02:00
events perf/x86: Fix smp_processor_id()-in-preemptible warnings 2024-07-31 12:57:39 +02:00
hyperv x86/mm: Make x86_platform.guest.enc_status_change_*() return an error 2024-06-17 17:45:53 +02:00
ia32
include x86/sched: Add basic support for CPU capacity scaling 2024-09-04 13:36:40 +02:00
kernel x86/sched: Add basic support for CPU capacity scaling 2024-09-04 13:36:40 +02:00
kvm KVM: x86: Make x2APIC ID 100% readonly 2024-08-13 12:01:46 -04:00
lib x86/uaccess: Zero the 8-byte get_range case on failure on 32-bit 2024-08-01 21:19:10 +02:00
math-emu x86/math-emu: Fix function cast warnings 2024-04-08 16:06:22 +02:00
mm x86/mm: Fix PTI for i386 some more 2024-08-07 15:35:01 +02:00
net bpf: remove unused parameter in bpf_jit_binary_pack_finalize 2024-06-20 19:50:26 -07:00
pci - Flip the logic to add feature names to /proc/cpuinfo to having to 2024-07-15 20:25:16 -07:00
platform xen: branch for v6.11-rc1a 2024-07-27 09:58:24 -07:00
power - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min 2024-03-14 18:03:09 -07:00
purgatory Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
ras
realmode Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
tools Changes: 2024-05-19 11:32:42 -07:00
um This pull request contains the following changes for UML: 2024-07-25 12:33:08 -07:00
video arch: Fix name collision with ACPI's video.o 2024-05-20 21:17:06 +00:00
virt - Add support for running the kernel in a SEV-SNP guest, over a Secure 2024-07-16 11:12:25 -07:00
xen xen: branch for v6.11-rc1a 2024-07-27 09:58:24 -07:00
.gitignore
Kbuild x86/build: Use obj-y to descend into arch/x86/virt/ 2024-03-30 10:41:49 +01:00
Kconfig Random number generator updates for Linux 6.11-rc1. 2024-07-24 10:29:50 -07:00
Kconfig.assembler x86/kconfig: Add as-instr64 macro to properly evaluate AS_WRUSS 2024-06-20 19:48:18 +02:00
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-09 16:28:19 +01:00
Kconfig.debug x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y 2024-05-20 11:37:23 +02:00
Makefile - A series ("kbuild: enable more warnings by default") from Arnd 2024-05-22 18:59:29 -07:00
Makefile_32.cpu
Makefile.postlink
Makefile.um arch: um: rust: Use the generated target.json again 2024-07-03 12:22:11 +02:00