]> git.proxmox.com Git - mirror_qemu.git/commit - cpu-common.c
system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 2 Jan 2024 15:35:25 +0000 (10:35 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 8 Jan 2024 15:45:43 +0000 (10:45 -0500)
commit195801d700c008b6a8d8acfa299aa5f177446647
tree7ab423e4a773b818f6c6d65f2fa06dc4517cad24
parent897a06c6d7ce8fb962a33cea1910d17218c746e9
system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

The Big QEMU Lock (BQL) has many names and they are confusing. The
actual QemuMutex variable is called qemu_global_mutex but it's commonly
referred to as the BQL in discussions and some code comments. The
locking APIs, however, are called qemu_mutex_lock_iothread() and
qemu_mutex_unlock_iothread().

The "iothread" name is historic and comes from when the main thread was
split into into KVM vcpu threads and the "iothread" (now called the main
loop thread). I have contributed to the confusion myself by introducing
a separate --object iothread, a separate concept unrelated to the BQL.

The "iothread" name is no longer appropriate for the BQL. Rename the
locking APIs to:
- void bql_lock(void)
- void bql_unlock(void)
- bool bql_locked(void)

There are more APIs with "iothread" in their names. Subsequent patches
will rename them. There are also comments and documentation that will be
updated in later patches.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Acked-by: Fabiano Rosas <farosas@suse.de>
Acked-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Peter Xu <peterx@redhat.com>
Acked-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Acked-by: Hyman Huang <yong.huang@smartx.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-id: 20240102153529.486531-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
95 files changed:
accel/accel-blocker.c
accel/dummy-cpus.c
accel/hvf/hvf-accel-ops.c
accel/kvm/kvm-accel-ops.c
accel/kvm/kvm-all.c
accel/tcg/cpu-exec.c
accel/tcg/cputlb.c
accel/tcg/tcg-accel-ops-icount.c
accel/tcg/tcg-accel-ops-mttcg.c
accel/tcg/tcg-accel-ops-rr.c
accel/tcg/tcg-accel-ops.c
accel/tcg/translate-all.c
audio/coreaudio.m
cpu-common.c
dump/dump.c
hw/core/cpu-common.c
hw/i386/intel_iommu.c
hw/i386/kvm/xen_evtchn.c
hw/i386/kvm/xen_overlay.c
hw/i386/kvm/xen_xenstore.c
hw/intc/arm_gicv3_cpuif.c
hw/intc/s390_flic.c
hw/misc/edu.c
hw/misc/imx6_src.c
hw/misc/imx7_src.c
hw/net/xen_nic.c
hw/ppc/pegasos2.c
hw/ppc/ppc.c
hw/ppc/spapr.c
hw/ppc/spapr_rng.c
hw/ppc/spapr_softmmu.c
hw/remote/mpqemu-link.c
hw/remote/vfio-user-obj.c
hw/s390x/s390-skeys.c
include/block/aio-wait.h
include/qemu/main-loop.h
include/qemu/thread.h
memory_ldst.c.inc
migration/block-dirty-bitmap.c
migration/block.c
migration/colo.c
migration/dirtyrate.c
migration/migration.c
migration/ram.c
replay/replay-internal.c
semihosting/console.c
stubs/iothread-lock.c
system/cpu-throttle.c
system/cpus.c
system/dirtylimit.c
system/memory.c
system/physmem.c
system/runstate.c
system/watchpoint.c
target/arm/arm-powerctl.c
target/arm/helper.c
target/arm/hvf/hvf.c
target/arm/kvm.c
target/arm/ptw.c
target/arm/tcg/helper-a64.c
target/arm/tcg/m_helper.c
target/arm/tcg/op_helper.c
target/arm/tcg/psci.c
target/hppa/int_helper.c
target/i386/hvf/README.md
target/i386/hvf/hvf.c
target/i386/kvm/hyperv.c
target/i386/kvm/kvm.c
target/i386/kvm/xen-emu.c
target/i386/nvmm/nvmm-accel-ops.c
target/i386/nvmm/nvmm-all.c
target/i386/tcg/sysemu/fpu_helper.c
target/i386/tcg/sysemu/misc_helper.c
target/i386/whpx/whpx-accel-ops.c
target/i386/whpx/whpx-all.c
target/loongarch/tcg/csr_helper.c
target/mips/kvm.c
target/mips/tcg/sysemu/cp0_helper.c
target/openrisc/sys_helper.c
target/ppc/excp_helper.c
target/ppc/kvm.c
target/ppc/misc_helper.c
target/ppc/timebase_helper.c
target/s390x/kvm/kvm.c
target/s390x/tcg/misc_helper.c
target/sparc/int32_helper.c
target/sparc/int64_helper.c
target/sparc/win_helper.c
target/xtensa/exc_helper.c
ui/cocoa.m
ui/spice-core.c
util/async.c
util/main-loop.c
util/qsp.c
util/rcu.c