qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v3 00/11] Reduce lock contention on TCG hot-path


From: Sergey Fedorov
Subject: [Qemu-devel] [PATCH v3 00/11] Reduce lock contention on TCG hot-path
Date: Tue, 12 Jul 2016 23:13:35 +0300

From: Sergey Fedorov <address@hidden>

Hi,

This is my respin of Alex's v2 series [1].

The first 8 patches are preparation for the patch 9, the subject matter
of this series, which enables lockless translation block lookup. The
main change here is that Paolo's suggestion is implemented: TBs are
marked with invalid CPU state early during invalidation. This allows to
make lockless lookup safe from races on 'tb_jmp_cache' and direct block
chaining.

The patch 10 is a simple solution to avoid unnecessary bouncing on
'tb_lock' between tb_gen_code() and tb_add_jump(). A local variable is
used to keep track of whether 'tb_lock' has already been taken.

The last patch is my attempt to restructure tb_find_{fast,slow}() into a
single function tb_find(). I think it will be easier to follow the
locking scheme this way. However, I am afraid this last patch can be
controversial, so it can be simply dropped.

This series can be fetch from the public git repository:

    https://github.com/sergefdrv/qemu.git lockless-tb-lookup-v3

[1] http://thread.gmane.org/gmane.comp.emulators.qemu/424856

Kind regards,
Sergey

Summary of changes in v3:
 - QHT memory ordering assumptions documented
 - 'tb_jmp_cache' reset in tb_flush() made atomic
 - explicit memory barriers removed around 'tb_jmp_cache' access
 - safe access to 'tb_flushed' out of 'tb_lock' prepared
 - TBs marked with invalid CPU state early on invalidation
 - Alex's tb_find_{fast,slow}() roll-up related patches dropped
 - bouncing of tb_lock between tb_gen_code() and tb_add_jump() avoided
   with local variable 'have_tb_lock'
 - tb_find_{fast,slow}() merged

Alex Bennée (2):
  tcg: set up tb->page_addr before insertion
  tcg: cpu-exec: remove tb_lock from the hot-path

Sergey Fedorov (9):
  util/qht: Document memory ordering assumptions
  cpu-exec: Pass last_tb by value to tb_find_fast()
  tcg: Prepare safe tb_jmp_cache lookup out of tb_lock
  tcg: Prepare safe access to tb_flushed out of tb_lock
  target-i386: Remove redundant HF_SOFTMMU_MASK
  tcg: Introduce tb_mark_invalid() and tb_is_invalid()
  tcg: Prepare TB invalidation for lockless TB lookup
  tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump()
  tcg: Merge tb_find_slow() and tb_find_fast()

 cpu-exec.c               | 110 +++++++++++++++++++++--------------------------
 include/exec/exec-all.h  |  10 +++++
 include/qemu/qht.h       |   9 ++++
 target-alpha/cpu.h       |  14 ++++++
 target-arm/cpu.h         |  14 ++++++
 target-cris/cpu.h        |  14 ++++++
 target-i386/cpu.c        |   3 --
 target-i386/cpu.h        |  20 +++++++--
 target-i386/translate.c  |  12 ++----
 target-lm32/cpu.h        |  14 ++++++
 target-m68k/cpu.h        |  14 ++++++
 target-microblaze/cpu.h  |  14 ++++++
 target-mips/cpu.h        |  14 ++++++
 target-moxie/cpu.h       |  14 ++++++
 target-openrisc/cpu.h    |  14 ++++++
 target-ppc/cpu.h         |  14 ++++++
 target-s390x/cpu.h       |  14 ++++++
 target-sh4/cpu.h         |  14 ++++++
 target-sparc/cpu.h       |  14 ++++++
 target-sparc/translate.c |   1 +
 target-tilegx/cpu.h      |  14 ++++++
 target-tricore/cpu.h     |  14 ++++++
 target-unicore32/cpu.h   |  14 ++++++
 target-xtensa/cpu.h      |  14 ++++++
 translate-all.c          |  30 ++++++-------
 util/qht.c               |   8 ++++
 26 files changed, 349 insertions(+), 92 deletions(-)

-- 
1.9.1




reply via email to

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