accel/tcg: Push BQL down into per-target do_interrupt handlers
Get series with b4
b4 am [email protected]Versions newest first
- v3 Latest10 of 11 patches 23 repliesIn review
Changes in v3 from the cover letter
- kind of rebase
- rename misleading fake_user_interrupt callback names for clarity
- restrict interrupt handlers to their appropriate modes (system vs user)
- explicitly document that do_interrupt() and cpu_exec_interrupt() callbacks are called WITH BQL held (explicit BQL contract in docstrings)
10 of 11 patches are in this archive. The cover letter announces 11.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | target/arm: Call arm*_cpu_do_interrupt directly instead of via TCGCPUOpstarget/ target/ | +2 | 4 replies | |
| 3/11 | target/i386: Rename fake_do_interrupt to fake_user_exceptionaccel/ include/ target/ +2 more | +11 | 1 reply | |
| 4/11 | accel/tcg: Document cpu_exec_interrupt() callback contractinclude/ target/ | +15 | 4 replies | |
| 5/11 | accel/tcg: Document do_interrupt() callback contractaccel/ include/ | +11 | 3 replies | |
| 6/11 | accel/tcg: Rename do_interrupt() to do_interrupt_locked()accel/ include/ target/ +18 more | +23 | 1 reply | |
| 7/11 | accel/tcg: Add do_interrupt() wrapper for targets to manage BQLaccel/ include/ | +22 | 1 reply | |
| 8/11 | target/hexagon: Move to do_interrupt() (BQL acquired internally)target/ | +1 | 3 replies | |
| 9/11 | targets: Move interrupt handlers to do_interrupt()target/ target/ target/ +1 more | +4 | 2 replies | |
| 10/11 | targets: Move BQL locking into do_interrupt() handlerstarget/ target/ target/ +25 more | +47 | 0 replies | |
| 11/11 | accel/tcg: Remove do_interrupt_locked() callbackaccel/ include/ | +2 | 1 reply |
Reviews trailers per patch
7 of 10 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Pierrick Bouvier | Brian Cain | Peter Maydell | Richard Henderson |
|---|---|---|---|---|
| Series | R-b | R-b | ||
| 1/11 | R-b | R-b | R-b | |
| 3/11 | R-b | |||
| 4/11 | ||||
| 5/11 | R-b | |||
| 6/11 | R-b | |||
| 7/11 | R-b | |||
| 8/11 | R-b | |||
| 9/11 | ||||
| 10/11 | ||||
| 11/11 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v3 00/11] accel/tcg: Push BQL down into per-target do_interrupt handlers
This is a respin of Robert Foley's v2 series from August 2020 [1] triggered by a broader review of BQL contract in my halt-to-exec transitions series by Peter [2] and Mark [3].
v3:
- kind of rebase
- rename misleading fake_user_interrupt callback names for clarity
- restrict interrupt handlers to their appropriate modes (system vs user)
- explicitly document that do_interrupt() and cpu_exec_interrupt() callbacks are called WITH BQL held (explicit BQL contract in docstrings)
v2 Summary
----------
This series pushes the Big QEMU Lock (BQL) down from the core TCG cpu_handle_interrupt/cpu_handle_exception paths into per-target implementations. This allows each architecture to manage BQL locking granularity independently, reducing contention on a known bottleneck as measured by QEMU sync profiling (qsp).
The BQL has long been a scaling bottleneck in QEMU, and the interrupt/exception handling path is one of its heaviest users. By allowing targets to acquire the BQL only when needed, we enable future per-target optimizations.
Refs:
[1] https://lore.kernel.org/qemu-devel/[email protected]/
[2] https://lore.kernel.org/qemu-devel/CAFEAcA8xk8y1W0UvttpVhKYuoMBSQqZoF_15of0Rrq4wKkWDuw@mail.gmail.com/
[3] https://lore.kernel.org/qemu-devel/[email protected]/
Philippe Mathieu-Daudé (10):
target/arm: Call arm*_cpu_do_interrupt directly instead of via
TCGCPUOps
target/s390x: Restrict interrupt handlers to system mode target/i386: Rename fake_do_interrupt to fake_user_exception accel/tcg: Document cpu_exec_interrupt() callback contract accel/tcg: Document do_interrupt() callback contract accel/tcg: Add do_interrupt() wrapper for targets to manage BQL target/hexagon: Move to do_interrupt() (BQL acquired internally)
targets: Move interrupt handlers to do_interrupt()
targets: Move BQL locking into do_interrupt() handlers accel/tcg: Remove do_interrupt_locked() callback
Robert Foley (1):
accel/tcg: Rename do_interrupt() to do_interrupt_locked()
include/accel/tcg/cpu-ops.h | 32 +++++++++++++++++++++++++---- target/arm/internals.h | 2 +- target/i386/tcg/helper-tcg.h | 4 +++- target/s390x/s390x-internal.h | 5 ++--- accel/tcg/cpu-exec.c | 7 +++---- target/alpha/helper.c | 3 +++ target/arm/cpu-irq.c | 2 +- target/arm/helper.c | 1 + target/arm/tcg/cpu-v7m.c | 2 +- target/arm/tcg/m_helper.c | 2 ++ target/avr/helper.c | 3 +++ target/hppa/int_helper.c | 2 ++ target/i386/tcg/system/seg_helper.c | 2 ++ target/i386/tcg/tcg-cpu.c | 2 +- target/i386/tcg/user/seg_helper.c | 6 +++--- target/mips/tcg/system/tlb_helper.c | 3 +++ target/ppc/excp_helper.c | 2 ++ target/rx/helper.c | 3 +++ target/s390x/tcg/excp_helper.c | 8 +++----- target/sh4/helper.c | 3 +++ target/sparc/int32_helper.c | 2 ++ target/sparc/int64_helper.c | 2 ++ target/xtensa/exc_helper.c | 2 ++ 23 files changed, 76 insertions(+), 24 deletions(-)
Signature · 1 line
2.53.0