qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Doubts regarding parallelism on KVM, IO threads


From: Paolo Bonzini
Subject: Re: [Qemu-devel] Doubts regarding parallelism on KVM, IO threads
Date: Thu, 3 Mar 2016 09:47:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0


On 03/03/2016 07:09, Gaurav Sharma wrote:
> Hi was trying to do some digging for multi core scenarios both with and
> without KVM.
> 
> In short i have some devices and a user application that does some r/w
> operations on those devices.
> 
> As per my understanding, in case binary translation using TCG is
> invoked, we only create a single Qemuthread for all vcpu's. In case of
> KVM we have a Qemuthread for each vcpu as TCG is bypassed in this case.
> 
> 
> [Test scenario]
> Lets say i have devices dev1 and dev2. Test application for dev1 is
> executed on core0 and dev2 on core1. 
> For device dev1, for testing purposes i specified some sleep whenever a
> read comes.
> In case KVM is enabled, whenever the sleep is hit my whole VM freezes.
> 
> 1. Are are devices emulated in a separate single thread ?

No, but device emulation and I/O all run behind the same mutex
(affectionately called "big QEMU lock").  See qemu_mutex_lock_iothread
and qemu_mutex_unlock_iothread.

Paolo

> 2. How and where in the code do we do a switch between CPU thread and
> IOthread ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]