All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC v2 00/11] Base enabling patches for MTTCG
@ 2016-04-05 15:32 Alex Bennée
  2016-04-05 15:32 ` [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState Alex Bennée
                   ` (10 more replies)
  0 siblings, 11 replies; 66+ messages in thread
From: Alex Bennée @ 2016-04-05 15:32 UTC (permalink / raw)
  To: mttcg, fred.konrad, a.rigo, serge.fdrv, cota
  Cc: peter.maydell, claudio.fontana, jan.kiszka, mark.burton,
	qemu-devel, pbonzini, Alex Bennée, rth

Hi,

This is the second iteration of the RFC patch set aims to provide the
basic framework for MTTCG. There wasn't much feedback on the first
posting but there has been some changes:

  - fixed bugs in single-thread mode w.r.t shutdown
  - tested multi-thread mode against (non)locking-test
  - included docs/multi-thread-tcg.txt design document
  - clean-ups to attribution and s-o-b tags
  - dropped tcg: move tb_find_fast outside the tb_lock critical
    - this was breaking the pxe tests in make check
  - pulled in tcg: move tb_invalidated_flag to CPUState (from Serge)
  - dropped cpu-exec: elide more icount code if CONFIG_USER_ONLY (to Serge)

The biggest changes were to the last patch that enables multi-threading
to fix various bugs. The single-thread case was failing to shutdown
due not bringing the system to wait on the halt_cond once no vCPUs
could be scheduled anymore. Conversely the multi-threaded mode was
crashing on the power-up of secondary vCPUs as the reset of vCPUs at
the start would leave the thread spinning instead of waiting on the
halt_cond until PSCI has cleanly enabled the vCPU.

The branch can be found at:

  https://github.com/stsquad/qemu/tree/mttcg/base-patches-v2

It has been built up on top of:

  https://github.com/stsquad/qemu/tree/mttcg/tb-and-tcg-cleanups

Which is just a collection of Serge's TCG cleanups not directly tied
to MTTCG which will hopefully get merged in due course well before
these patches.

What's next
===========

This series should now behave as normal in the default single threaded
mode - any regressions are bugs that I'd like to know about.

multi-threaded mode works for any guests that don't make assumptions
about atomicity, memory consistency or cache flushes. Basically simple
kvm-unit-test cases. I've been using the simple locking-test:

  ./arm/run ./arm/locking-test.flat -smp 4 [-tcg mttcg=on]

Default:
real    0m42.335s
user    0m42.296s
sys     0m0.024s

Multi-threaded:
real    1m32.928s
user    2m15.704s
sys     3m4.840s

Obviously the performance in this simple test case is a regression
(mainly due to lock contention). This is to be expected and something
I hope can be addressed as this series is built on with ways of
reducing lock contention and safely handling the various invalidation
operations.

I hope this works as a good base for further MTTCG development. My
next step will be to re-build the remaining patches from Fred's
multi_tcg_v8 so the changes to enable ARMv7 on x86 can be reviewed.
This basically involves adding:

  - async_safe_work and associated flushes
  - atomic safety
  - defaulting to on

Obviously I await the various trees from Serge, Alvise and Emilio with interest ;-)

In the meantime any review comments gratefully received.

Cheers,

Alex


Alex Bennée (5):
  cpus: make all_vcpus_paused() return bool
  docs: new design document multi-thread-tcg.txt (DRAFTING)
  target-arm/psci.c: wake up sleeping CPUs
  tcg: cpus rm tcg_exec_all()
  tcg: add kick timer for single-threaded vCPU emulation

Jan Kiszka (1):
  tcg: drop global lock during TCG code execution

KONRAD Frederic (3):
  tcg: protect TBContext with tb_lock.
  tcg: add options for enabling MTTCG
  tcg: enable thread-per-vCPU

Paolo Bonzini (2):
  tcg: move tb_invalidated_flag to CPUState
  tcg: comment on which functions have to be called with tb_lock held

 cpu-exec-common.c         |   1 -
 cpu-exec.c                |  46 +++---
 cpus.c                    | 357 +++++++++++++++++++++++++++++++---------------
 cputlb.c                  |   1 +
 docs/multi-thread-tcg.txt | 184 ++++++++++++++++++++++++
 exec.c                    |  16 +++
 hw/i386/kvmvapic.c        |   6 +
 include/exec/exec-all.h   |   7 +-
 include/qom/cpu.h         |  19 +++
 include/sysemu/cpus.h     |   2 +
 memory.c                  |   2 +
 qemu-options.hx           |  14 ++
 softmmu_template.h        |  17 +++
 target-arm/psci.c         |   2 +
 target-i386/smm_helper.c  |   7 +
 tcg/tcg.h                 |   2 +
 translate-all.c           |  89 ++++++++----
 vl.c                      |  12 +-
 18 files changed, 613 insertions(+), 171 deletions(-)
 create mode 100644 docs/multi-thread-tcg.txt

-- 
2.7.4

^ permalink raw reply	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2016-06-02 16:36 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-05 15:32 [Qemu-devel] [RFC v2 00/11] Base enabling patches for MTTCG Alex Bennée
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState Alex Bennée
2016-04-05 15:44   ` Paolo Bonzini
2016-04-06 10:11     ` Sergey Fedorov
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 02/11] cpus: make all_vcpus_paused() return bool Alex Bennée
2016-04-11 12:48   ` Sergey Fedorov
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 03/11] docs: new design document multi-thread-tcg.txt (DRAFTING) Alex Bennée
2016-04-11 20:00   ` Sergey Fedorov
2016-05-25 15:48     ` Sergey Fedorov
2016-05-25 16:01       ` Alex Bennée
2016-05-25 18:03       ` Paolo Bonzini
2016-05-25 18:13         ` Sergey Fedorov
2016-05-06 11:25   ` Sergey Fedorov
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 04/11] tcg: comment on which functions have to be called with tb_lock held Alex Bennée
2016-05-05 14:19   ` Sergey Fedorov
2016-05-05 15:03     ` Alex Bennée
2016-05-05 15:25       ` Sergey Fedorov
2016-05-05 15:42         ` Sergey Fedorov
2016-05-06 18:22   ` Sergey Fedorov
2016-05-11 12:58     ` Paolo Bonzini
2016-05-11 13:36       ` Sergey Fedorov
2016-05-11 13:46         ` Paolo Bonzini
2016-05-12 19:32           ` Sergey Fedorov
2016-05-13  9:25             ` Paolo Bonzini
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 05/11] tcg: protect TBContext with tb_lock Alex Bennée
2016-05-11 12:45   ` Sergey Fedorov
2016-05-11 12:52     ` Paolo Bonzini
2016-05-11 13:42       ` Sergey Fedorov
2016-06-01 10:30     ` Alex Bennée
2016-06-02 14:37       ` Sergey Fedorov
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 06/11] target-arm/psci.c: wake up sleeping CPUs Alex Bennée
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 07/11] tcg: cpus rm tcg_exec_all() Alex Bennée
2016-05-26 11:03   ` Sergey Fedorov
2016-05-26 13:10     ` Alex Bennée
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 08/11] tcg: add options for enabling MTTCG Alex Bennée
2016-04-11 20:50   ` Sergey Fedorov
2016-04-12 11:48     ` Alex Bennée
2016-04-12 11:59       ` Peter Maydell
2016-04-12 12:42         ` Sergey Fedorov
2016-04-12 12:50           ` KONRAD Frederic
2016-04-12 13:00             ` Sergey Fedorov
2016-04-12 13:03               ` Pavel Dovgalyuk
2016-04-12 13:19                 ` Sergey Fedorov
2016-04-12 14:23                 ` Alex Bennée
2016-05-09 10:47                   ` Paolo Bonzini
2016-04-12 12:48       ` Sergey Fedorov
2016-05-09 10:45     ` Paolo Bonzini
2016-05-09 11:50       ` Alex Bennée
2016-04-12 13:23   ` Sergey Fedorov
2016-04-12 14:28     ` Alex Bennée
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 09/11] tcg: add kick timer for single-threaded vCPU emulation Alex Bennée
2016-04-11 21:39   ` Sergey Fedorov
2016-06-02 16:00     ` Alex Bennée
2016-06-02 16:05       ` Sergey Fedorov
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 10/11] tcg: drop global lock during TCG code execution Alex Bennée
2016-05-24 21:28   ` Sergey Fedorov
2016-05-25 10:33     ` Paolo Bonzini
2016-05-25 11:07       ` Alex Bennée
2016-05-25 12:46         ` Paolo Bonzini
2016-04-05 15:32 ` [Qemu-devel] [RFC v2 11/11] tcg: enable thread-per-vCPU Alex Bennée
2016-05-27 13:57   ` Sergey Fedorov
2016-05-27 14:55     ` Paolo Bonzini
2016-05-27 15:07       ` Sergey Fedorov
2016-05-27 15:25         ` Paolo Bonzini
2016-05-27 18:54           ` Sergey Fedorov
2016-06-02 16:36             ` Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.