[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v3 00/19] Base enabling patches for MTTCG

From: Alex Bennée
Subject: [Qemu-devel] [RFC v3 00/19] Base enabling patches for MTTCG
Date: Fri, 3 Jun 2016 21:40:09 +0100

This is the third iteration of the RFC patch set which aims to provide
the basic framework for MTTCG. There have been some considerable
changes since the last extensive review (thanks to all the reviewers).

   - many updates to docs/multi-thread-tcg.txt design document
   - added assertions for all the locking requirements
   - split apart the big enable thread-per-vCPU patch
   - removed locking from the hot-path

In general the main thread functions are a lot less messy (especially
the single thread variant). The splitting apart of the big enabling
patch was helped by removing tcg_current_cpu and the global
exit_request as separate patches. Finally the big performance boost of
a lockless hot-path is made possible by Emilio's QHT work which this
is based on.

The branch can be found at:


It has been built up on top of:


What's next

This series should now behave as normal in the default single threaded
mode and in multi-threaded mode where SMP==1. Please report any
regressions/bugs you find.

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 -accel tcg,thread=[single|multi]

real    0m14.804s
user    0m14.752s
sys     0m0.032s

real    0m6.307s
user    0m23.396s
sys     0m0.020s

With the lockless hot-path (thanks QHT ;-) we can now see a benefit in
running with multiple threads with a slight cost to overall CPU time.
I intend to run a more complete set of benchmarks once I'm re-based by
ARM specific series on top of this patch-set (and compared the LL/SC
work with the simple lock based exclusives in the original series.)

In the meantime any review comments gratefully received.



Alex Bennée (15):
  cpus: make all_vcpus_paused() return bool
  translate_all: DEBUG_FLUSH -> DEBUG_TB_FLUSH
  translate-all: add DEBUG_LOCKING asserts
  docs: new design document multi-thread-tcg.txt (DRAFTING)
  exec: add assert_debug_safe and notes on debug structures
  translate-all: Add assert_memory_lock annotations
  target-arm/arm-powerctl: wake up sleeping CPUs
  tcg: cpus rm tcg_exec_all()
  tcg: add kick timer for single-threaded vCPU emulation
  tcg: rename tcg_current_cpu to tcg_current_rr_cpu
  tcg: remove global exit_request
  tcg: drop global lock during TCG code execution
  tcg: move locking for tb_invalidate_phys_page_range up
  tcg: enable thread-per-vCPU
  cpu-exec: remove tb_lock from the hot-path

KONRAD Frederic (2):
  tcg: protect TBContext with tb_lock.
  tcg: add options for enabling MTTCG

Paolo Bonzini (1):
  tcg: comment on which functions have to be called with tb_lock held

Sergey Fedorov (1):
  tcg: Ensure safe TB lookup out of 'tb_lock'

 bsd-user/mmap.c           |   5 +
 cpu-exec-common.c         |   3 -
 cpu-exec.c                | 104 ++++++-----
 cpus.c                    | 448 ++++++++++++++++++++++++++++------------------
 cputlb.c                  |   1 +
 docs/multi-thread-tcg.txt | 225 +++++++++++++++++++++++
 exec.c                    |  87 ++++++++-
 hw/i386/kvmvapic.c        |   4 +
 include/exec/exec-all.h   |   6 +-
 include/qom/cpu.h         |  11 ++
 include/sysemu/cpus.h     |   2 +
 linux-user/elfload.c      |   4 +
 linux-user/main.c         |   1 +
 linux-user/mmap.c         |   5 +
 memory.c                  |   2 +
 qemu-options.hx           |  20 +++
 softmmu_template.h        |  17 ++
 target-arm/Makefile.objs  |   2 +-
 target-arm/arm-powerctl.c |   2 +
 target-i386/smm_helper.c  |   7 +
 tcg/tcg.h                 |   2 +
 translate-all.c           | 187 +++++++++++++++----
 vl.c                      |  45 ++++-
 23 files changed, 931 insertions(+), 259 deletions(-)
 create mode 100644 docs/multi-thread-tcg.txt


reply via email to

[Prev in Thread] Current Thread [Next in Thread]