qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v5 00/13] cpu-exec: Safe work in quiescent state
@ 2016-08-02 17:27 Alex Bennée
  2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 01/13] atomic: introduce atomic_dec_fetch Alex Bennée
                   ` (12 more replies)
  0 siblings, 13 replies; 25+ messages in thread
From: Alex Bennée @ 2016-08-02 17:27 UTC (permalink / raw)
  To: mttcg, qemu-devel, fred.konrad, a.rigo, serge.fdrv, cota,
	bobby.prani
  Cc: mark.burton, pbonzini, jan.kiszka, rth, peter.maydell,
	claudio.fontana, Alex Bennée

Hi,

I've picked up this work from Sergey and will be taking it forward
from now on.

Apart from adding my s-o-b tags to all the patches there are only two
changes. Both are to wait_safe_cpu_work function to prevent dead-lock
conditions.

First I have added the macro can_wait_for_safe() which compiles away
to 0 on SoftMMU. This will be tweaked in later MTTCG work.

Second I have ensured we signal the qemu_exclusive_cond conditional if
tcg_pending_threads is 0 by the time to we want to sleep waiting for
safe work to run.

Finally I've added another patch at the end of the series which
converts everything to a GArray. The main driver was my MTTCG test
case which was particularly stressing of memory as multi-thousand
queues of flushes backed up. I've since mitigated that with other
changes to the cputlb code but it does have the advantage of avoiding
bouncing the lock as we go through the queue. If people aren't happy
with the change we can always drop it.

I'm keen to get this work merged as soon as the tree re-opens so any
additional comments will be helpful.

I've been using this patch set along with the hot-path tweaks in
Paolo's tree as a base for the ongoing MTTCG patches. When I post the
next set of patches they will be based of this tree:

  https://github.com/stsquad/qemu/tree/mttcg/async-safe-work-v5

Which is:
  - v2.7.0-rc0
  - plus Reduce lock contention on TCG hot-path (v5, Paolo's tree)
  - plus cpu-exec: Safe work in quiescent state (v5, this series)

Alex Bennée (3):
  atomic: introduce atomic_dec_fetch.
  cpus: pass CPUState to run_on_cpu helpers
  cpu-exec: replace cpu->queued_work with GArray

Sergey Fedorov (10):
  cpus: Move common code out of {async_,}run_on_cpu()
  cpus: Wrap mutex used to protect CPU work
  cpus: Rename flush_queued_work()
  linux-user: Use QemuMutex and QemuCond
  linux-user: Rework exclusive operation mechanism
  linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick()
  linux-user: Support CPU work queue
  bsd-user: Support CPU work queue
  cpu-exec-common: Introduce async_safe_run_on_cpu()
  tcg: Make tb_flush() thread safe

 bsd-user/main.c            |  16 +++++
 cpu-exec-common.c          | 157 +++++++++++++++++++++++++++++++++++++++++++++
 cpu-exec.c                 |  12 +---
 cpus.c                     | 108 ++++++-------------------------
 hw/i386/kvm/apic.c         |   3 +-
 hw/i386/kvmvapic.c         |   6 +-
 hw/ppc/ppce500_spin.c      |  31 +++------
 hw/ppc/spapr.c             |   6 +-
 hw/ppc/spapr_hcall.c       |  17 ++---
 include/exec/exec-all.h    |  31 +++++++++
 include/qemu/atomic.h      |   4 ++
 include/qom/cpu.h          |  30 ++++++---
 kvm-all.c                  |  21 ++----
 linux-user/main.c          |  94 +++++++++++++++++----------
 target-i386/helper.c       |  19 +++---
 target-i386/kvm.c          |   6 +-
 target-s390x/cpu.c         |   4 +-
 target-s390x/cpu.h         |   7 +-
 target-s390x/kvm.c         |  98 ++++++++++++++--------------
 target-s390x/misc_helper.c |   4 +-
 translate-all.c            |  17 +++--
 21 files changed, 420 insertions(+), 271 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2016-08-31 10:09 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 17:27 [Qemu-devel] [PATCH v5 00/13] cpu-exec: Safe work in quiescent state Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 01/13] atomic: introduce atomic_dec_fetch Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 02/13] cpus: pass CPUState to run_on_cpu helpers Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 03/13] cpus: Move common code out of {async_, }run_on_cpu() Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 04/13] cpus: Wrap mutex used to protect CPU work Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 05/13] cpus: Rename flush_queued_work() Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 06/13] linux-user: Use QemuMutex and QemuCond Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 07/13] linux-user: Rework exclusive operation mechanism Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 08/13] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick() Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 09/13] linux-user: Support CPU work queue Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 10/13] bsd-user: " Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 11/13] cpu-exec-common: Introduce async_safe_run_on_cpu() Alex Bennée
2016-08-02 19:22   ` Emilio G. Cota
2016-08-03 21:02     ` Alex Bennée
2016-08-03 23:17       ` Emilio G. Cota
2016-08-04  6:44         ` Alex Bennée
2016-08-28  0:21     ` Paolo Bonzini
2016-08-29 17:26       ` Paolo Bonzini
2016-08-31 10:09         ` Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 12/13] tcg: Make tb_flush() thread safe Alex Bennée
2016-08-02 17:27 ` [Qemu-devel] [PATCH v5 13/13] cpu-exec: replace cpu->queued_work with GArray Alex Bennée
2016-08-02 17:36   ` Alex Bennée
2016-08-02 17:42   ` Alex Bennée
2016-08-02 18:53   ` Emilio G. Cota
2016-08-03  8:34     ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).