[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 02/19] system/cpus: Only kick running vCPUs
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 02/19] system/cpus: Only kick running vCPUs |
Date: |
Fri, 6 Jun 2025 18:44:01 +0200 |
As an optimization, avoid kicking stopped vCPUs.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
system/cpus.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/system/cpus.c b/system/cpus.c
index d16b0dff989..4835e5ced48 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -494,6 +494,11 @@ void cpus_kick_thread(CPUState *cpu)
void qemu_cpu_kick(CPUState *cpu)
{
qemu_cond_broadcast(cpu->halt_cond);
+
+ if (!cpu_can_run(cpu)) {
+ return;
+ }
+
if (cpus_accel->kick_vcpu_thread) {
cpus_accel->kick_vcpu_thread(cpu);
} else { /* default */
--
2.49.0
[RFC PATCH 03/19] accel: Keep reference to AccelOpsClass in AccelClass, Philippe Mathieu-Daudé, 2025/06/06
[RFC PATCH 04/19] accel: Propagate AccelState to AccelClass::init_machine(), Philippe Mathieu-Daudé, 2025/06/06
[RFC PATCH 05/19] accel/kvm: Prefer local AccelState over global MachineState::accel, Philippe Mathieu-Daudé, 2025/06/06