[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 14/16] cpus-common: Introduce async_safe_run_on_
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH 14/16] cpus-common: Introduce async_safe_run_on_cpu() |
Date: |
Wed, 21 Sep 2016 12:08:38 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Sep 19, 2016 at 14:50:57 +0200, Paolo Bonzini wrote:
> We have to run safe work items outside the BQL; for now keep other
> work items within the BQL, though this can be changed relatively
> easily as a follow-up.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> cpus-common.c | 33 +++++++++++++++++++++++++++++++--
> include/qom/cpu.h | 14 ++++++++++++++
> 2 files changed, 45 insertions(+), 2 deletions(-)
>
> diff --git a/cpus-common.c b/cpus-common.c
> index 6adc982..f7ad534 100644
> --- a/cpus-common.c
> +++ b/cpus-common.c
> @@ -106,7 +106,7 @@ struct qemu_work_item {
> struct qemu_work_item *next;
> run_on_cpu_func func;
> void *data;
> - bool free, done;
> + bool free, exclusive, done;
> };
>
> static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi)
> @@ -139,6 +139,7 @@ void do_run_on_cpu(CPUState *cpu, run_on_cpu_func func,
> void *data,
> wi.data = data;
> wi.done = false;
> wi.free = false;
> + wi.exclusive = false;
>
> queue_work_on_cpu(cpu, &wi);
> while (!atomic_mb_read(&wi.done)) {
> @@ -157,6 +158,7 @@ void async_run_on_cpu(CPUState *cpu, run_on_cpu_func
> func, void *data)
> wi->func = func;
> wi->data = data;
> wi->free = true;
> + wi->exclusive = false;
Just a very pedantic nit: in patch 08/19 we don't set wi->done false because
there's a malloc0 right above this. So we might want to do the same here.
E.
- Re: [Qemu-devel] [PATCH 13/16] cpus-common: simplify locking for start_exclusive/end_exclusive, (continued)
[Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for cpu_exec_start/end, Paolo Bonzini, 2016/09/19
[Qemu-devel] [PATCH 14/16] cpus-common: Introduce async_safe_run_on_cpu(), Paolo Bonzini, 2016/09/19
Re: [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state, no-reply, 2016/09/19
Re: [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state, no-reply, 2016/09/19
Re: [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state, Emilio G. Cota, 2016/09/21