[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu. |
Date: |
Fri, 26 Jun 2015 18:23:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 |
On 26/06/2015 18:09, Frederic Konrad wrote:
>>>
>>> +void async_run_safe_work_on_cpu(CPUState *cpu, void (*func)(void
>>> *data),
>>> + void *data)
>>> +{
>> Do you need a mutex to protect this data structure? I would use one
>> even if not strictly necessary, to avoid introducing new BQL-protected
>> structures.
>
> For the moment it's called by tb_invalidate and tb_flush_safe the second
> lacks a
> tb_lock/unlock which should be added. I don't need an other mutex expect
> if this is
> used elsewhere?
In any case, the locking policy should be documented.
At which point you realize that protecting a CPU's
queued_safe_work_{first,next} fields with the tb_lock is a bit weird. :)
I would add a mutex inside CPUState, and then later we could also use
it for regular run_on_cpu/async_run_on_cpu.
Paolo
- Re: [Qemu-devel] [RFC PATCH V6 07/18] Drop global lock during TCG code execution, (continued)
[Qemu-devel] [RFC PATCH V6 12/18] Use atomic cmpxchg to atomically check the exclusive value in a STREX, fred . konrad, 2015/06/26
[Qemu-devel] [RFC PATCH V6 14/18] add a callback when tb_invalidate is called., fred . konrad, 2015/06/26
[Qemu-devel] [RFC PATCH V6 16/18] arm: use tlb_flush*_all, fred . konrad, 2015/06/26
[Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu., fred . konrad, 2015/06/26
[Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., fred . konrad, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Paolo Bonzini, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Frederic Konrad, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Paolo Bonzini, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Peter Maydell, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Frederic Konrad, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Paolo Bonzini, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Frederic Konrad, 2015/06/26
- Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all., Paolo Bonzini, 2015/06/26