|author||Claudio Fontana <email@example.com>||2020-06-29 11:35:03 +0200|
|committer||Paolo Bonzini <firstname.lastname@example.org>||2020-07-10 18:04:49 -0400|
cpu-throttle: new module, extracted from cpus.c
move the vcpu throttling functionality into its own module. This functionality is not specific to any accelerator, and it is used currently by migration to slow down guests to try to have migrations converge, and by the cocoa MacOS UI to throttle speed. cpu-throttle contains the controls to adjust and inspect throttle settings, start (set) and stop vcpu throttling, and the throttling function itself that is run periodically on vcpus to make them take a nap. Execution of the throttling function on all vcpus is triggered by a timer, registered at module initialization. No functionality change. Signed-off-by: Claudio Fontana <email@example.com> Reviewed-by: Alex Bennée <firstname.lastname@example.org> Reviewed-by: Laurent Vivier <email@example.com> Message-Id: <firstname.lastname@example.org> Signed-off-by: Paolo Bonzini <email@example.com>
Diffstat (limited to 'include/hw')
1 files changed, 0 insertions, 37 deletions
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index b3f4b79318..5542577d2b 100644
@@ -822,43 +822,6 @@ bool cpu_exists(int64_t id);
CPUState *cpu_by_arch_id(int64_t id);
- * cpu_throttle_set:
- * @new_throttle_pct: Percent of sleep time. Valid range is 1 to 99.
- * Throttles all vcpus by forcing them to sleep for the given percentage of
- * time. A throttle_percentage of 25 corresponds to a 75% duty cycle roughly.
- * (example: 10ms sleep for every 30ms awake).
- * cpu_throttle_set can be called as needed to adjust new_throttle_pct.
- * Once the throttling starts, it will remain in effect until cpu_throttle_stop
- * is called.
-void cpu_throttle_set(int new_throttle_pct);
- * cpu_throttle_stop:
- * Stops the vcpu throttling started by cpu_throttle_set.
- * cpu_throttle_active:
- * Returns: %true if the vcpus are currently being throttled, %false otherwise.
- * cpu_throttle_get_percentage:
- * Returns the vcpu throttle percentage. See cpu_throttle_set for details.
- * Returns: The throttle percentage in range 1 to 99.
typedef void (*CPUInterruptHandler)(CPUState *, int);