Skip to content

accel/tcg: remove implied BQL from cpu_handle_interrupt/exception path

Robert Foley qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/core: Add bql_interrupt flag to CPUClasshw/core/cpu.c include/hw/core/cpu.h+9 -05 replies
2/2accel/tcg: interrupt/exception handling uses bql_interrupt flagaccel/tcg/cpu-exec.c+26 -85 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] accel/tcg: remove implied BQL from cpu_handle_interrupt/exception path

The purpose of this change is to set the groundwork so that an arch could move towards removing the BQL from the cpu_handle_interrupt/exception paths.

The BQL is a bottlneck in scaling to more cores.
And this cpu_handle_interrupt/exception path is one of the key BQL users as measured by the QEMU sync profiling (qsp).

We have chosen to break up the process of removing BQL from this path into two pieces:

1) Changes to the core/common functions
of cpu_handle_interrupt/exception
allowing a per-arch decision to hold BQL. The common case and the default is for the core code to hold the BQL (bql=true).
This set of changes is handled in this patch.

2) Removing the BQL from the per-arch functions.
1) makes it possible for an arch to set bql=false so that the common code does not hold the BQL across the cpu_handle_interrupt/exception call. This allows the arch to handle locking in this path We leave it up to the arch to make the change at the time that makes sense.

It is worth mentioning that we are working on per-arch changes in line with 2), and plan to submit these.
In other words, we plan to set the groundwork with this patch series and then will take advantage of it in later series.

This patch series is based on the per-CPU locks patch:
https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg05314.html

Robert Foley (2):
hw/core: Add bql_interrupt flag to CPUClass accel/tcg: interrupt/exception handling uses bql_interrupt flag

 accel/tcg/cpu-exec.c  | 34 ++++++++++++++++++++++++++--------
 hw/core/cpu.c         |  1 +
 include/hw/core/cpu.h |  8 ++++++++
 3 files changed, 35 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.1