per-CPU locks
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v10 Latest73 patches 0 repliesNew
- v974 patches 4 repliesSuperseded
- v874 patches 25 repliesSuperseded
Changes in v10 from the cover letter
- Fixed one case in cpu_throttle_thread, where we were using qemu_global_mutex instead of cpu->lock for the halt_cond.
- Changed qemu_cpu_kick() to ensure we are under the CPU lock so we do not miss a notification.
- Added a few more reviewed-bys.
Patches in v10 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/73 | cpu: rename cpu->work_mutex to cpu->lockcpus-common.c cpus.c hw/ +1 more | +15 | 0 replies | |
| 2/73 | cpu: introduce cpu_mutex_lock/unlockcpus.c hw/ include/ +2 more | +101 | 0 replies | |
| 3/73 | cpu: make qemu_work_cond per-cpucpus-common.c cpus.c hw/ +1 more | +63 | 0 replies | |
| 4/73 | cpu: move run_on_cpu to cpus-commoncpus-common.c cpus.c include/ | +1 | 0 replies | |
| 5/73 | cpu: introduce process_queued_cpu_work_lockedcpus-common.c | +11 | 0 replies | |
| 6/73 | cpu: make per-CPU locks an alias of the BQL in TCG rr modecpus-common.c cpus.c hw/ +2 more | +110 | 0 replies | |
| 7/73 | tcg-runtime: define helper_cpu_halted_setaccel/ accel/ | +9 | 0 replies | |
| 8/73 | ppc: convert to helper_cpu_halted_settarget/ | +2 | 0 replies | |
| 9/73 | cris: convert to helper_cpu_halted_settarget/ | +3 | 0 replies | |
| 10/73 | hppa: convert to helper_cpu_halted_settarget/ | +1 | 0 replies | |
| 11/73 | m68k: convert to helper_cpu_halted_settarget/ | +4 | 0 replies | |
| 12/73 | alpha: convert to helper_cpu_halted_settarget/ | +2 | 0 replies | |
| 13/73 | microblaze: convert to helper_cpu_halted_settarget/ | +1 | 0 replies | |
| 14/73 | cpu: define cpu_halted helpersinclude/ | +24 | 0 replies | |
| 15/73 | tcg-runtime: convert to cpu_halted_setaccel/ | +1 | 0 replies | |
| 16/73 | hw/semihosting: convert to cpu_halted_sethw/ | +2 | 0 replies | |
| 17/73 | arm: convert to cpu_haltedhw/ hw/ hw/ +3 more | +9 | 0 replies | |
| 18/73 | ppc: convert to cpu_haltedhw/ hw/ hw/ +7 more | +34 | 0 replies | |
| 19/73 | sh4: convert to cpu_haltedtarget/ | +1 | 0 replies | |
| 20/73 | i386: convert to cpu_haltedtarget/ target/ target/ +6 more | +20 | 0 replies | |
| 21/73 | lm32: convert to cpu_haltedtarget/ | +2 | 0 replies | |
| 22/73 | m68k: convert to cpu_haltedtarget/ | +1 | 0 replies | |
| 23/73 | mips: convert to cpu_haltedhw/ hw/ target/ +3 more | +10 | 0 replies | |
| 24/73 | riscv: convert to cpu_haltedtarget/ | +1 | 0 replies | |
| 25/73 | s390x: convert to cpu_haltedhw/ target/ target/ +2 more | +22 | 0 replies | |
| 26/73 | sparc: convert to cpu_haltedhw/ hw/ hw/ +1 more | +8 | 0 replies | |
| 27/73 | xtensa: convert to cpu_haltedtarget/ target/ target/ | +3 | 0 replies | |
| 28/73 | gdbstub: convert to cpu_haltedgdbstub.c | +2 | 0 replies | |
| 29/73 | openrisc: convert to cpu_haltedtarget/ | +1 | 0 replies | |
| 30/73 | cpu-exec: convert to cpu_haltedaccel/ | +21 | 0 replies | |
| 31/73 | cpu: convert to cpu_haltedaccel/ cpus.c hw/ +1 more | +5 | 0 replies | |
| 32/73 | cpu: define cpu_interrupt_request helpershw/ include/ | +58 | 0 replies | |
| 33/73 | ppc: use cpu_reset_interrupttarget/ | +1 | 0 replies | |
| 34/73 | exec: use cpu_reset_interruptexec.c | +1 | 0 replies | |
| 35/73 | i386: use cpu_reset_interrupttarget/ target/ target/ +3 more | +25 | 0 replies | |
| 36/73 | s390x: use cpu_reset_interrupttarget/ | +1 | 0 replies | |
| 37/73 | openrisc: use cpu_reset_interrupttarget/ | +1 | 0 replies | |
| 38/73 | arm: convert to cpu_interrupt_requesttarget/ target/ target/ | +11 | 0 replies | |
| 39/73 | i386: convert to cpu_interrupt_requesttarget/ target/ target/ | +5 | 0 replies | |
| 40/73 | i386/kvm: convert to cpu_interrupt_requesttarget/ | +35 | 0 replies | |
| 41/73 | i386/hax-all: convert to cpu_interrupt_requesttarget/ | +19 | 0 replies | |
| 42/73 | i386/whpx-all: convert to cpu_interrupt_requesttarget/ | +24 | 0 replies | |
| 43/73 | i386/hvf: convert to cpu_request_interrupttarget/ target/ | +20 | 0 replies | |
| 44/73 | ppc: convert to cpu_interrupt_requesthw/ target/ target/ +1 more | +9 | 0 replies | |
| 45/73 | sh4: convert to cpu_interrupt_requesttarget/ target/ | +2 | 0 replies | |
| 46/73 | cris: convert to cpu_interrupt_requesttarget/ target/ | +3 | 0 replies | |
| 47/73 | hppa: convert to cpu_interrupt_requesttarget/ | +1 | 0 replies | |
| 48/73 | lm32: convert to cpu_interrupt_requesttarget/ | +1 | 0 replies | |
| 49/73 | m68k: convert to cpu_interrupt_requesttarget/ | +1 | 0 replies | |
| 50/73 | mips: convert to cpu_interrupt_requesttarget/ target/ | +5 | 0 replies | |
| 51/73 | nios: convert to cpu_interrupt_requesttarget/ | +1 | 0 replies | |
| 52/73 | s390x: convert to cpu_interrupt_requesthw/ target/ | +2 | 0 replies | |
| 53/73 | alpha: convert to cpu_interrupt_requesttarget/ | +4 | 0 replies | |
| 54/73 | moxie: convert to cpu_interrupt_requesttarget/ | +1 | 0 replies | |
| 55/73 | sparc: convert to cpu_interrupt_requesthw/ target/ | +3 | 0 replies | |
| 56/73 | openrisc: convert to cpu_interrupt_requesthw/ target/ | +3 | 0 replies | |
| 57/73 | unicore32: convert to cpu_interrupt_requesttarget/ target/ | +2 | 0 replies | |
| 58/73 | microblaze: convert to cpu_interrupt_requesttarget/ | +1 | 0 replies | |
| 59/73 | accel/tcg: convert to cpu_interrupt_requestaccel/ accel/ accel/ | +18 | 0 replies | |
| 60/73 | cpu: convert to interrupt_requesthw/ | +2 | 0 replies | |
| 61/73 | cpu: call .cpu_has_work with the CPU lock heldinclude/ | +10 | 0 replies | |
| 62/73 | cpu: introduce cpu_has_work_with_iothread_lockinclude/ | +34 | 0 replies | |
| 63/73 | ppc: convert to cpu_has_work_with_iothread_locktarget/ | +14 | 0 replies | |
| 64/73 | mips: convert to cpu_has_work_with_iothread_locktarget/ | +3 | 0 replies | |
| 65/73 | s390x: convert to cpu_has_work_with_iothread_locktarget/ | +3 | 0 replies | |
| 66/73 | riscv: convert to cpu_has_work_with_iothread_locktarget/ | +4 | 0 replies | |
| 67/73 | sparc: convert to cpu_has_work_with_iothread_locktarget/ | +3 | 0 replies | |
| 68/73 | xtensa: convert to cpu_has_work_with_iothread_locktarget/ | +3 | 0 replies | |
| 69/73 | cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idlecpus.c | +6 | 0 replies | |
| 70/73 | cpu: protect CPU state with cpu->lock instead of the BQLcpus.c hw/ include/ | +248 | 0 replies | |
| 71/73 | cpus-common: release BQL earlier in run_on_cpucpus-common.c | +5 | 0 replies | |
| 72/73 | cpu: add async_run_on_cpu_no_bqlcpus-common.c include/ | +48 | 0 replies | |
| 73/73 | cputlb: queue async flush jobs without the BQLaccel/ | +5 | 0 replies |
Reviews trailers per patch
All 73 patches have a Reviewed-by or Acked-by.
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 11 reviewers.
Cover letter [PATCH v10 00/73] per-CPU locks
Changes for v10:
- Fixed one case in cpu_throttle_thread, where we were using qemu_global_mutex instead of cpu->lock for the halt_cond.
- Changed qemu_cpu_kick() to ensure we are under the CPU lock so we do not miss a notification.
- Added a few more reviewed-bys.
v9: https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg06289.html
Quoting an earlier patch in the series:
"For context, the goal of this series is to substitute the BQL for the per-CPU locks in many places, notably the execution loop in cpus.c. This leads to better scalability for MTTCG, since CPUs don't have to acquire a contended global lock (the BQL) every time they stop executing code.
See the last commit for some performance numbers."
Emilio G. Cota (68):
cpu: rename cpu->work_mutex to cpu->lock
cpu: introduce cpu_mutex_lock/unlock
cpu: make qemu_work_cond per-cpu
cpu: move run_on_cpu to cpus-common
cpu: introduce process_queued_cpu_work_locked
cpu: make per-CPU locks an alias of the BQL in TCG rr mode
tcg-runtime: define helper_cpu_halted_set
ppc: convert to helper_cpu_halted_set
cris: convert to helper_cpu_halted_set
hppa: convert to helper_cpu_halted_set
m68k: convert to helper_cpu_halted_set
alpha: convert to helper_cpu_halted_set
microblaze: convert to helper_cpu_halted_set
cpu: define cpu_halted helpers
tcg-runtime: convert to cpu_halted_set
arm: convert to cpu_halted
ppc: convert to cpu_halted
sh4: convert to cpu_halted
i386: convert to cpu_halted
lm32: convert to cpu_halted
m68k: convert to cpu_halted
mips: convert to cpu_halted
riscv: convert to cpu_halted
s390x: convert to cpu_halted
sparc: convert to cpu_halted
xtensa: convert to cpu_halted
gdbstub: convert to cpu_halted
openrisc: convert to cpu_halted
cpu-exec: convert to cpu_halted
cpu: convert to cpu_halted
cpu: define cpu_interrupt_request helpers
exec: use cpu_reset_interrupt
arm: convert to cpu_interrupt_request
i386: convert to cpu_interrupt_request
i386/kvm: convert to cpu_interrupt_request
i386/hax-all: convert to cpu_interrupt_request i386/whpx-all: convert to cpu_interrupt_request
i386/hvf: convert to cpu_request_interrupt
ppc: convert to cpu_interrupt_request
sh4: convert to cpu_interrupt_request
cris: convert to cpu_interrupt_request
hppa: convert to cpu_interrupt_request
lm32: convert to cpu_interrupt_request
m68k: convert to cpu_interrupt_request
mips: convert to cpu_interrupt_request
nios: convert to cpu_interrupt_request
s390x: convert to cpu_interrupt_request
alpha: convert to cpu_interrupt_request
moxie: convert to cpu_interrupt_request
sparc: convert to cpu_interrupt_request
openrisc: convert to cpu_interrupt_request
unicore32: convert to cpu_interrupt_request
microblaze: convert to cpu_interrupt_request
accel/tcg: convert to cpu_interrupt_request
cpu: convert to interrupt_request
cpu: call .cpu_has_work with the CPU lock held
cpu: introduce cpu_has_work_with_iothread_lock
ppc: convert to cpu_has_work_with_iothread_lock
mips: convert to cpu_has_work_with_iothread_lock
s390x: convert to cpu_has_work_with_iothread_lock
riscv: convert to cpu_has_work_with_iothread_lock
sparc: convert to cpu_has_work_with_iothread_lock
xtensa: convert to cpu_has_work_with_iothread_lock
cpu: rename all_cpu_threads_idle to qemu_tcg_rr_all_cpu_threads_idle
cpu: protect CPU state with cpu->lock instead of the BQL
cpus-common: release BQL earlier in run_on_cpu
cpu: add async_run_on_cpu_no_bql
cputlb: queue async flush jobs without the BQL
Paolo Bonzini (4):
ppc: use cpu_reset_interrupt
i386: use cpu_reset_interrupt
s390x: use cpu_reset_interrupt
openrisc: use cpu_reset_interrupt
Robert Foley (1):
hw/semihosting: convert to cpu_halted_set
accel/tcg/cpu-exec.c | 40 ++- accel/tcg/cputlb.c | 10 +- accel/tcg/tcg-all.c | 12 +- accel/tcg/tcg-runtime.c | 7 + accel/tcg/tcg-runtime.h | 2 + accel/tcg/translate-all.c | 2 +- cpus-common.c | 108 ++++++-- cpus.c | 456 ++++++++++++++++++++++++++------ exec.c | 2 +- gdbstub.c | 4 +- hw/arm/omap1.c | 4 +- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/pxa2xx_pic.c | 2 +- hw/core/cpu.c | 28 +- hw/core/machine-qmp-cmds.c | 2 +- hw/core/machine.c | 1 + hw/intc/s390_flic.c | 4 +- hw/mips/cps.c | 2 +- hw/misc/mips_itu.c | 4 +- hw/openrisc/cputimer.c | 2 +- hw/ppc/e500.c | 4 +- hw/ppc/ppc.c | 12 +- hw/ppc/ppce500_spin.c | 6 +- hw/ppc/spapr_cpu_core.c | 4 +- hw/ppc/spapr_hcall.c | 14 +- hw/ppc/spapr_rtas.c | 8 +- hw/semihosting/console.c | 4 +- hw/sparc/leon3.c | 2 +- hw/sparc/sun4m.c | 8 +- hw/sparc64/sparc64.c | 8 +- include/hw/core/cpu.h | 196 ++++++++++++-- stubs/Makefile.objs | 1 + stubs/cpu-lock.c | 27 ++ target/alpha/cpu.c | 8 +- target/alpha/translate.c | 6 +- target/arm/arm-powerctl.c | 6 +- target/arm/cpu.c | 8 +- target/arm/helper.c | 16 +- target/arm/machine.c | 2 +- target/arm/op_helper.c | 2 +- target/cris/cpu.c | 2 +- target/cris/helper.c | 4 +- target/cris/translate.c | 5 +- target/hppa/cpu.c | 2 +- target/hppa/translate.c | 3 +- target/i386/cpu.c | 4 +- target/i386/cpu.h | 2 +- target/i386/hax-all.c | 42 +-- target/i386/helper.c | 8 +- target/i386/hvf/hvf.c | 12 +- target/i386/hvf/x86hvf.c | 37 +-- target/i386/kvm.c | 82 +++--- target/i386/misc_helper.c | 2 +- target/i386/seg_helper.c | 13 +- target/i386/svm_helper.c | 6 +- target/i386/whpx-all.c | 57 ++-- target/lm32/cpu.c | 2 +- target/lm32/op_helper.c | 4 +- target/m68k/cpu.c | 2 +- target/m68k/op_helper.c | 2 +- target/m68k/translate.c | 9 +- target/microblaze/cpu.c | 2 +- target/microblaze/translate.c | 4 +- target/mips/cp0_helper.c | 6 +- target/mips/cpu.c | 11 +- target/mips/kvm.c | 4 +- target/mips/op_helper.c | 2 +- target/mips/translate.c | 4 +- target/moxie/cpu.c | 2 +- target/nios2/cpu.c | 2 +- target/openrisc/cpu.c | 4 +- target/openrisc/sys_helper.c | 4 +- target/ppc/excp_helper.c | 6 +- target/ppc/helper_regs.h | 2 +- target/ppc/kvm.c | 6 +- target/ppc/translate.c | 6 +- target/ppc/translate_init.inc.c | 41 +-- target/riscv/cpu.c | 5 +- target/riscv/op_helper.c | 2 +- target/s390x/cpu.c | 28 +- target/s390x/excp_helper.c | 4 +- target/s390x/kvm.c | 2 +- target/s390x/sigp.c | 8 +- target/sh4/cpu.c | 2 +- target/sh4/helper.c | 2 +- target/sh4/op_helper.c | 2 +- target/sparc/cpu.c | 6 +- target/sparc/helper.c | 2 +- target/unicore32/cpu.c | 2 +- target/unicore32/softmmu.c | 2 +- target/xtensa/cpu.c | 6 +- target/xtensa/exc_helper.c | 2 +- target/xtensa/helper.c | 2 +- 93 files changed, 1063 insertions(+), 456 deletions(-) create mode 100644 stubs/cpu-lock.c
Signature · 1 line
2.17.1