[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] system/cpus: rename qemu_global_mutex to qemu_bql
- To: qemu-devel@xxxxxxxxxx
- From: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
- Date: Wed, 29 Nov 2023 16:26:23 -0500
- Cc: Jean-Christophe Dubois <jcd@xxxxxxxxxxxxxxx>, Fabiano Rosas <farosas@xxxxxxx>, qemu-s390x@xxxxxxxxxx, Song Gao <gaosong@xxxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Hyman Huang <yong.huang@xxxxxxxxxx>, Marcelo Tosatti <mtosatti@xxxxxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>, Andrey Smirnov <andrew.smirnov@xxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Kevin Wolf <kwolf@xxxxxxxxxx>, Ilya Leoshkevich <iii@xxxxxxxxxxxxx>, Artyom Tarasenko <atar4qemu@xxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Jagannathan Raman <jag.raman@xxxxxxxxxx>, Juan Quintela <quintela@xxxxxxxxxx>, Daniel P. Berrangé <berrange@xxxxxxxxxx>, qemu-arm@xxxxxxxxxx, Jason Wang <jasowang@xxxxxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxxxxx>, Hanna Reitz <hreitz@xxxxxxxxxx>, Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>, BALATON Zoltan <balaton@xxxxxxxxxx>, Daniel Henrique Barboza <danielhb413@xxxxxxxxx>, Elena Ufimtseva <elena.ufimtseva@xxxxxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>, Hailiang Zhang <zhanghailiang@xxxxxxxxxxx>, Roman Bolshakov <rbolshakov@xxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, Fam Zheng <fam@xxxxxxxxxx>, Eric Blake <eblake@xxxxxxxxxx>, Jiri Slaby <jslaby@xxxxxxx>, Alexander Graf <agraf@xxxxxxxxx>, Liu Zhiwei <zhiwei_liu@xxxxxxxxxxxxxxxxx>, Weiwei Li <liwei1518@xxxxxxxxx>, Eric Farman <farman@xxxxxxxxxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Markus Armbruster <armbru@xxxxxxxxxx>, Reinoud Zandijk <reinoud@xxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Cameron Esfahani <dirty@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Pavel Dovgalyuk <pavel.dovgaluk@xxxxxxxxx>, qemu-riscv@xxxxxxxxxx, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, John Snow <jsnow@xxxxxxxxxx>, Sunil Muthuswamy <sunilmut@xxxxxxxxxxxxx>, Michael Roth <michael.roth@xxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Bin Meng <bin.meng@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, Stefan Hajnoczi <stefanha@xxxxxxxxxx>, qemu-block@xxxxxxxxxx, Halil Pasic <pasic@xxxxxxxxxxxxx>, Peter Xu <peterx@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Harsh Prateek Bora <harshpb@xxxxxxxxxxxxx>, Alex Bennée <alex.bennee@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Vladimir Sementsov-Ogievskiy <vsementsov@xxxxxxxxxxxxxx>, Cédric Le Goater <clg@xxxxxxxx>, qemu-ppc@xxxxxxxxxx, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Akihiko Odaki <akihiko.odaki@xxxxxxxxxx>, Leonardo Bras <leobras@xxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>
- Delivery-date: Wed, 29 Nov 2023 21:26:52 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
The APIs using qemu_global_mutex now follow the Big QEMU Lock (BQL)
nomenclature. It's a little strange that the actual QemuMutex variable
that embodies the BQL is called qemu_global_mutex instead of qemu_bql.
Rename it for consistency.
Signed-off-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
---
system/cpus.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/system/cpus.c b/system/cpus.c
index eb24a4db8e..138720a540 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -65,7 +65,7 @@
#endif /* CONFIG_LINUX */
-static QemuMutex qemu_global_mutex;
+static QemuMutex qemu_bql;
/*
* The chosen accelerator is supposed to register this.
@@ -389,14 +389,14 @@ void qemu_init_cpu_loop(void)
qemu_init_sigbus();
qemu_cond_init(&qemu_cpu_cond);
qemu_cond_init(&qemu_pause_cond);
- qemu_mutex_init(&qemu_global_mutex);
+ qemu_mutex_init(&qemu_bql);
qemu_thread_get_self(&io_thread);
}
void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data)
{
- do_run_on_cpu(cpu, func, data, &qemu_global_mutex);
+ do_run_on_cpu(cpu, func, data, &qemu_bql);
}
static void qemu_cpu_stop(CPUState *cpu, bool exit)
@@ -428,7 +428,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(cpu->halt_cond, &qemu_bql);
}
if (slept) {
qemu_plugin_vcpu_resume_cb(cpu);
@@ -502,7 +502,7 @@ void qemu_bql_lock_impl(const char *file, int line)
QemuMutexLockFunc bql_lock = qatomic_read(&qemu_bql_mutex_lock_func);
g_assert(!qemu_bql_locked());
- bql_lock(&qemu_global_mutex, file, line);
+ bql_lock(&qemu_bql, file, line);
set_bql_locked(true);
}
@@ -510,17 +510,17 @@ void qemu_bql_unlock(void)
{
g_assert(qemu_bql_locked());
set_bql_locked(false);
- qemu_mutex_unlock(&qemu_global_mutex);
+ qemu_mutex_unlock(&qemu_bql);
}
void qemu_cond_wait_bql(QemuCond *cond)
{
- qemu_cond_wait(cond, &qemu_global_mutex);
+ qemu_cond_wait(cond, &qemu_bql);
}
void qemu_cond_timedwait_bql(QemuCond *cond, int ms)
{
- qemu_cond_timedwait(cond, &qemu_global_mutex, ms);
+ qemu_cond_timedwait(cond, &qemu_bql, ms);
}
/* signal CPU creation */
@@ -571,7 +571,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(&qemu_pause_cond, &qemu_bql);
CPU_FOREACH(cpu) {
qemu_cpu_kick(cpu);
}
@@ -649,7 +649,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(&qemu_cpu_cond, &qemu_bql);
}
}
--
2.42.0
|