All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state
@ 2016-09-12 11:12 Paolo Bonzini
  2016-09-12 11:12 ` [Qemu-devel] [PATCH 01/16] cpus: pass CPUState to run_on_cpu helpers Paolo Bonzini
                   ` (16 more replies)
  0 siblings, 17 replies; 27+ messages in thread
From: Paolo Bonzini @ 2016-09-12 11:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: sergey.fedorov, alex.bennee

In addition to fixing some of the issues found by Alex, safe work items
need not run anymore with a mutex taken.  Of course, cpu_exec_start/end
and start_exclusive/end_exclusive are essentially the read and write
side of a specialized rwlock, so there is still a lock in disguise looming
to cause deadlocks; however, it does removes worries about recursive
locking from CPU list manipulations.

The new patches are 8, 12 and 13.  Patch 12 of v6 has been split
across patch 10 and patch 16.

Paolo

v6->v7: Do not separate qemu_work_item and SafeWorkItem
        More cleanups/optimizations of exclusive section logic

Alex Bennée (1):
  cpus: pass CPUState to run_on_cpu helpers

Paolo Bonzini (9):
  cpus-common: move CPU list management to common code
  cpus-common: fix uninitialized variable use in run_on_cpu
  cpus-common: move exclusive work infrastructure from linux-user
  docs: include formal model for TCG exclusive sections
  cpus-common: always defer async_run_on_cpu work items
  cpus-common: remove redundant call to exclusive_idle()
  cpus-common: simplify locking for start_exclusive/end_exclusive
  cpus-common: Introduce async_safe_run_on_cpu()
  cpus-common: lock-free fast path for cpu_exec_start/end

Sergey Fedorov (6):
  cpus: Move common code out of {async_, }run_on_cpu()
  cpus: Rename flush_queued_work()
  linux-user: Use QemuMutex and QemuCond
  linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick()
  cpus-common: move CPU work item management to common code
  tcg: Make tb_flush() thread safe

 Makefile.target            |   2 +-
 bsd-user/main.c            |  33 ++---
 cpu-exec.c                 |  12 +-
 cpus-common.c              | 335 +++++++++++++++++++++++++++++++++++++++++++++
 cpus.c                     |  99 +-------------
 docs/tcg-exclusive.promela | 224 ++++++++++++++++++++++++++++++
 exec.c                     |  37 +----
 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/cpu-all.h     |   4 +
 include/exec/cpu-common.h  |   2 +
 include/exec/exec-all.h    |  11 --
 include/exec/tb-context.h  |   2 +-
 include/qom/cpu.h          |  99 ++++++++++++--
 kvm-all.c                  |  21 +--
 linux-user/main.c          | 130 ++++++------------
 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            |  38 +++--
 vl.c                       |   1 +
 27 files changed, 836 insertions(+), 415 deletions(-)
 create mode 100644 cpus-common.c
 create mode 100644 docs/tcg-exclusive.promela

-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state
@ 2016-09-19 12:50 Paolo Bonzini
  2016-09-19 12:50 ` [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu Paolo Bonzini
  0 siblings, 1 reply; 27+ messages in thread
From: Paolo Bonzini @ 2016-09-19 12:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: sergey.fedorov, serge.fdrv, alex.bennee

In addition to fixing some of the issues found by Alex, safe work items
need not run anymore with a mutex taken.  Of course, cpu_exec_start/end
and start_exclusive/end_exclusive are essentially the read and write
side of a specialized rwlock, so there is still a lock in disguise looming
to cause deadlocks; however, it does removes worries about recursive
locking from CPU list manipulations.

The new patches are 8, 12 and 13.  Patch 12 of v6 has been split
across patch 10 and patch 16.

Paolo

v7->v8: rebase


Alex Bennée (1):
  cpus: pass CPUState to run_on_cpu helpers

Paolo Bonzini (9):
  cpus-common: move CPU list management to common code
  cpus-common: fix uninitialized variable use in run_on_cpu
  cpus-common: move exclusive work infrastructure from linux-user
  docs: include formal model for TCG exclusive sections
  cpus-common: always defer async_run_on_cpu work items
  cpus-common: remove redundant call to exclusive_idle()
  cpus-common: simplify locking for start_exclusive/end_exclusive
  cpus-common: Introduce async_safe_run_on_cpu()
  cpus-common: lock-free fast path for cpu_exec_start/end

Sergey Fedorov (6):
  cpus: Move common code out of {async_, }run_on_cpu()
  cpus: Rename flush_queued_work()
  linux-user: Use QemuMutex and QemuCond
  linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick()
  cpus-common: move CPU work item management to common code
  tcg: Make tb_flush() thread safe

 Makefile.objs              |   2 +-
 bsd-user/main.c            |  33 ++---
 cpu-exec.c                 |  12 +-
 cpus-common.c              | 343 +++++++++++++++++++++++++++++++++++++++++++++
 cpus.c                     |  99 +------------
 docs/tcg-exclusive.promela | 224 +++++++++++++++++++++++++++++
 exec.c                     |  37 +----
 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/cpu-common.h  |   5 +
 include/exec/exec-all.h    |  11 --
 include/exec/tb-context.h  |   2 +-
 include/qom/cpu.h          | 102 ++++++++++++--
 kvm-all.c                  |  21 +--
 linux-user/main.c          | 130 ++++++-----------
 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            |  38 +++--
 vl.c                       |   1 +
 26 files changed, 846 insertions(+), 415 deletions(-)
 create mode 100644 cpus-common.c
 create mode 100644 docs/tcg-exclusive.promela

-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [Qemu-devel] [PATCH v8 00/16] cpu-exec: Safe work in quiescent state
@ 2016-09-23  7:31 Paolo Bonzini
  2016-09-23  7:31 ` [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu Paolo Bonzini
  0 siblings, 1 reply; 27+ messages in thread
From: Paolo Bonzini @ 2016-09-23  7:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, sergey.fedorov, alex.bennee, serge.fdrv

Changes from v7

patch 1: one more instance to change

patch 4: rename cpu_list_mutex to cpu_list_lock [Emilio]
         avoid problems from spurious wakeups [me]

patch 6: rename qemu_cpu_list_mutex to qemu_cpu_list_lock (ripples
         to other patches afterwards) [Emilio]

patch 13: adjust comments on top of start_exclusive/end_exclusive [Emilio]

patch 14: do not set wi->exclusive [Emilio]

patch 16: use atomics for pending_cpus and cpu->running
          (not for cpu->has_waiter) [Emilio]


Alex Bennée (1):
  cpus: pass CPUState to run_on_cpu helpers

Paolo Bonzini (9):
  cpus-common: move CPU list management to common code
  cpus-common: fix uninitialized variable use in run_on_cpu
  cpus-common: move exclusive work infrastructure from linux-user
  docs: include formal model for TCG exclusive sections
  cpus-common: always defer async_run_on_cpu work items
  cpus-common: remove redundant call to exclusive_idle()
  cpus-common: simplify locking for start_exclusive/end_exclusive
  cpus-common: Introduce async_safe_run_on_cpu()
  cpus-common: lock-free fast path for cpu_exec_start/end

Sergey Fedorov (6):
  cpus: Move common code out of {async_, }run_on_cpu()
  cpus: Rename flush_queued_work()
  linux-user: Use QemuMutex and QemuCond
  linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick()
  cpus-common: move CPU work item management to common code
  tcg: Make tb_flush() thread safe

 Makefile.objs              |   2 +-
 bsd-user/main.c            |  33 ++---
 cpu-exec.c                 |  12 +-
 cpus-common.c              | 352 +++++++++++++++++++++++++++++++++++++++++++++
 cpus.c                     |  99 +------------
 docs/tcg-exclusive.promela | 224 +++++++++++++++++++++++++++++
 exec.c                     |  37 +----
 hw/i386/kvm/apic.c         |   5 +-
 hw/i386/kvmvapic.c         |   6 +-
 hw/ppc/ppce500_spin.c      |  31 ++--
 hw/ppc/spapr.c             |   6 +-
 hw/ppc/spapr_hcall.c       |  17 +--
 include/exec/cpu-common.h  |   5 +
 include/exec/exec-all.h    |  11 --
 include/exec/tb-context.h  |   2 +-
 include/qom/cpu.h          | 102 +++++++++++--
 kvm-all.c                  |  21 +--
 linux-user/main.c          | 130 +++++------------
 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            |  38 +++--
 vl.c                       |   1 +
 26 files changed, 856 insertions(+), 416 deletions(-)
 create mode 100644 cpus-common.c
 create mode 100644 docs/tcg-exclusive.promela

-- 
2.7.4

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

end of thread, other threads:[~2016-09-23 17:16 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 11:12 [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 01/16] cpus: pass CPUState to run_on_cpu helpers Paolo Bonzini
2016-09-15 15:30   ` Alex Bennée
2016-09-12 11:12 ` [Qemu-devel] [PATCH 02/16] cpus: Move common code out of {async_, }run_on_cpu() Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 03/16] cpus: Rename flush_queued_work() Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 04/16] linux-user: Use QemuMutex and QemuCond Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 05/16] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick() Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 06/16] cpus-common: move CPU list management to common code Paolo Bonzini
2016-09-22 15:24   ` Alex Bennée
2016-09-22 15:27     ` Paolo Bonzini
2016-09-22 15:51       ` Alex Bennée
2016-09-12 11:12 ` [Qemu-devel] [PATCH 07/16] cpus-common: move CPU work item " Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu Paolo Bonzini
2016-09-22 15:37   ` Alex Bennée
2016-09-12 11:12 ` [Qemu-devel] [PATCH 09/16] cpus-common: move exclusive work infrastructure from linux-user Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 10/16] docs: include formal model for TCG exclusive sections Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 11/16] cpus-common: always defer async_run_on_cpu work items Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 12/16] cpus-common: remove redundant call to exclusive_idle() Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 13/16] cpus-common: simplify locking for start_exclusive/end_exclusive Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 14/16] cpus-common: Introduce async_safe_run_on_cpu() Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe Paolo Bonzini
2016-09-12 11:12 ` [Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for cpu_exec_start/end Paolo Bonzini
2016-09-14 17:16 ` [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state Richard Henderson
2016-09-14 18:40   ` Paolo Bonzini
2016-09-19 12:50 Paolo Bonzini
2016-09-19 12:50 ` [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu Paolo Bonzini
2016-09-23  7:31 [Qemu-devel] [PATCH v8 00/16] cpu-exec: Safe work in quiescent state Paolo Bonzini
2016-09-23  7:31 ` [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu Paolo Bonzini
2016-09-23 17:15   ` Richard Henderson

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.