[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/16] cpus-common: move CPU work item managemen
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 07/16] cpus-common: move CPU work item management to common code |
Date: |
Wed, 21 Sep 2016 19:15:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 21/09/2016 19:03, Emilio G. Cota wrote:
>> > - wi = g_malloc0(sizeof(struct qemu_work_item));
>> > - wi->func = func;
>> > - wi->data = data;
>> > - wi->free = true;
>> > -
>> > - queue_work_on_cpu(cpu, wi);
>> > + do_run_on_cpu(cpu, func, data, &qemu_global_mutex);
>> > }
> AFAICT this is the only caller of do_run_on_cpu. Is qemu_global_mutex
> necessary here? I wonder if we could just use cpu->work_mutex to wait
> on a per-cpu work_cond. Contending for a global lock here doesn't
> make much sense unless I'm missing something. Furthermore, that change
> would allow us to get rid of the atomic accesses to wi.done, which I
> dislike.
Yes, this will be a follow up.
We pass qemu_global_mutex here for qemu_cond_wait to drop the BQL. But
the real solution is to run work item outside the BQL; they don't need it.
Paolo
- [Qemu-devel] [PATCH v7 00/16] cpu-exec: Safe work in quiescent state, (continued)
- [Qemu-devel] [PATCH 06/16] cpus-common: move CPU list management to common code, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 09/16] cpus-common: move exclusive work infrastructure from linux-user, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 10/16] docs: include formal model for TCG exclusive sections, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 11/16] cpus-common: always defer async_run_on_cpu work items, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 12/16] cpus-common: remove redundant call to exclusive_idle(), Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 13/16] cpus-common: simplify locking for start_exclusive/end_exclusive, Paolo Bonzini, 2016/09/19
[Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe, Paolo Bonzini, 2016/09/19