All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/11] Reduce lock contention on TCG hot-path
@ 2016-07-12 20:13 Sergey Fedorov
  2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 01/11] util/qht: Document memory ordering assumptions Sergey Fedorov
                   ` (11 more replies)
  0 siblings, 12 replies; 49+ messages in thread
From: Sergey Fedorov @ 2016-07-12 20:13 UTC (permalink / raw)
  To: qemu-devel, mttcg, fred.konrad, a.rigo, serge.fdrv, cota,
	bobby.prani, rth
  Cc: patches, mark.burton, pbonzini, jan.kiszka, peter.maydell,
	claudio.fontana, Alex Bennée

From: Sergey Fedorov <serge.fdrv@gmail.com>

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

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

end of thread, other threads:[~2016-07-15 13:18 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12 20:13 [Qemu-devel] [PATCH v3 00/11] Reduce lock contention on TCG hot-path Sergey Fedorov
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 01/11] util/qht: Document memory ordering assumptions Sergey Fedorov
2016-07-12 23:19   ` Emilio G. Cota
2016-07-13  7:36     ` Paolo Bonzini
2016-07-13 17:50       ` Sergey Fedorov
2016-07-14 13:56         ` Paolo Bonzini
2016-07-14 14:08           ` Sergey Fedorov
2016-07-13 11:13   ` Paolo Bonzini
2016-07-13 18:03     ` Sergey Fedorov
2016-07-14  8:05       ` Paolo Bonzini
2016-07-15 12:37     ` Sergey Fedorov
2016-07-15 12:51       ` Paolo Bonzini
2016-07-15 13:18         ` Sergey Fedorov
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 02/11] cpu-exec: Pass last_tb by value to tb_find_fast() Sergey Fedorov
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 03/11] tcg: Prepare safe tb_jmp_cache lookup out of tb_lock Sergey Fedorov
2016-07-14 12:14   ` Alex Bennée
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 04/11] tcg: Prepare safe access to tb_flushed " Sergey Fedorov
2016-07-14 12:45   ` Alex Bennée
2016-07-14 12:55     ` Sergey Fedorov
2016-07-14 13:12       ` Alex Bennée
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 05/11] target-i386: Remove redundant HF_SOFTMMU_MASK Sergey Fedorov
2016-07-14 12:19   ` Alex Bennée
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 06/11] tcg: Introduce tb_mark_invalid() and tb_is_invalid() Sergey Fedorov
2016-07-14 10:25   ` Alex Bennée
2016-07-14 11:10     ` Sergey Fedorov
2016-07-14 11:48       ` Paolo Bonzini
2016-07-14 12:04         ` Alex Bennée
2016-07-14 12:53   ` Alex Bennée
2016-07-14 13:00     ` Sergey Fedorov
2016-07-14 13:12       ` Paolo Bonzini
2016-07-14 13:15       ` Alex Bennée
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 07/11] tcg: Prepare TB invalidation for lockless TB lookup Sergey Fedorov
2016-07-14 12:59   ` Alex Bennée
2016-07-14 13:11     ` Sergey Fedorov
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 08/11] tcg: set up tb->page_addr before insertion Sergey Fedorov
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 09/11] tcg: cpu-exec: remove tb_lock from the hot-path Sergey Fedorov
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 10/11] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump() Sergey Fedorov
2016-07-14 13:01   ` Alex Bennée
2016-07-14 13:13     ` Sergey Fedorov
2016-07-12 20:13 ` [Qemu-devel] [PATCH v3 11/11] tcg: Merge tb_find_slow() and tb_find_fast() Sergey Fedorov
2016-07-14 13:02   ` Alex Bennée
2016-07-13  7:39 ` [Qemu-devel] [PATCH v3 00/11] Reduce lock contention on TCG hot-path Paolo Bonzini
2016-07-13 17:00   ` Sergey Fedorov
2016-07-14  9:55     ` Alex Bennée
2016-07-14 11:13       ` Sergey Fedorov
2016-07-13 18:06   ` Sergey Fedorov
2016-07-14 12:02   ` Alex Bennée
2016-07-14 12:10     ` Paolo Bonzini
2016-07-14 13:13       ` 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.