[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 5/8] cpus: Use qemu_cond_wait_iothread() where proper
|
From: |
Peter Xu |
|
Subject: |
[PATCH v3 5/8] cpus: Use qemu_cond_wait_iothread() where proper |
|
Date: |
Wed, 28 Jul 2021 14:31:48 -0400 |
The helper is introduced but we've still got plenty of places that are directly
referencing the qemu_global_mutex itself. Spread the usage.
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
softmmu/cpus.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 49e0368438..e714dfbf2b 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -439,7 +439,7 @@ void qemu_wait_io_event(CPUState *cpu)
slept = true;
qemu_plugin_vcpu_idle_cb(cpu);
}
- qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
+ qemu_cond_wait_iothread(cpu->halt_cond);
}
if (slept) {
qemu_plugin_vcpu_resume_cb(cpu);
@@ -582,7 +582,7 @@ void pause_all_vcpus(void)
replay_mutex_unlock();
while (!all_vcpus_paused()) {
- qemu_cond_wait(&qemu_pause_cond, &qemu_global_mutex);
+ qemu_cond_wait_iothread(&qemu_pause_cond);
CPU_FOREACH(cpu) {
qemu_cpu_kick(cpu);
}
@@ -653,7 +653,7 @@ void qemu_init_vcpu(CPUState *cpu)
cpus_accel->create_vcpu_thread(cpu);
while (!cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
+ qemu_cond_wait_iothread(&qemu_cpu_cond);
}
}
--
2.31.1
- [PATCH v3 0/8] memory: Sanity checks memory transaction when releasing BQL, Peter Xu, 2021/07/28
- [PATCH v3 1/8] cpus: Export queue work related fields to cpu.h, Peter Xu, 2021/07/28
- [PATCH v3 3/8] memory: Introduce memory_region_transaction_depth_{inc|dec}(), Peter Xu, 2021/07/28
- [PATCH v3 2/8] cpus: Move do_run_on_cpu into softmmu/cpus.c, Peter Xu, 2021/07/28
- [PATCH v3 4/8] memory: Don't do topology update in memory finalize(), Peter Xu, 2021/07/28
- [PATCH v3 5/8] cpus: Use qemu_cond_wait_iothread() where proper,
Peter Xu <=
- [PATCH v3 6/8] cpus: Remove the mutex parameter from do_run_on_cpu(), Peter Xu, 2021/07/28
- [PATCH v3 8/8] memory: Delay the transaction pop() until commit completed, Peter Xu, 2021/07/28
- [PATCH v3 7/8] memory: Assert on no ongoing memory transaction before release BQL, Peter Xu, 2021/07/28