[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/
Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?
Wed, 13 May 2015 14:30:38 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
On 13/05/2015 12:03, Paolo Bonzini wrote:
On 13/05/2015 11:41, Peter Maydell wrote:
For -icount and SMP, yes. I even posted a patch to that end once.
I don't see why -icount and SMP need to be mutually exclusive.
If we're round-robining between the SMP CPUs then they should
all stay deterministic, I would have thought?
No, because the round-robin switches happen non-deterministically when
the I/O thread kicks the VCPU in qemu_mutex_lock_iothread.
It gets worse with BQL-free TCG which lets you remove the kicks
altogether (and the round-robin disappears in favor of true
multithreading). Even you could keep the kicks, having both round-robin
and multi-threading would be extra complication in the code and cause of
If you're talking of the kick_thread, kick_cpu, I think we should keep that.
We need to be able to synchronize all VCPUs somehow when we want to do for
example tb/tlb flush and tb_invalidate so we are sure no others VCPU will be
But then yes, we will probably have pain with icount and make it less
than it is today (it's broken in my series though because of
which does a tb_invalidate).
You can get -icount and multi-threaded TCG (which for UP is simply TCG
with execution out of the BQL) together I think. For example you could
handle cpu->icount_decr.u16.low == 0 like cpu->halted, hanging the CPU
thread until QEMU_CLOCK_VIRTUAL timers have been processed. The I/O
thread would have to kick the CPU after processing QEMU_CLOCK_VIRTUAL
timers---not hard to do.
Multithreaded TCG for a UP guest isn't very interesting though...
BQL-free TCG is interesting though, for two reasons:
1) maintainability: get rid of all the aforementioned "kick VCPU" stuff
2) performance: allow handling of I/O events to run in parallel with the
VCPU, rather than the lockstep technique we have now. This improves
performance, so that for example you might get rid of the artificial
ratelimiting in ptimer.c.
In case it wasn't clear, BQL-freedom is the main reason why I'm
interested in multithreaded TCG! :)
Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?, Pavel Dovgaluk, 2015/05/13
Message not available