From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhL6B-0002VR-1q for qemu-devel@nongnu.org; Thu, 14 Jul 2011 08:33:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhL69-0001iP-8Y for qemu-devel@nongnu.org; Thu, 14 Jul 2011 08:32:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhL68-0001iK-Qz for qemu-devel@nongnu.org; Thu, 14 Jul 2011 08:32:57 -0400 Message-ID: <4E1EE1F2.5020801@redhat.com> Date: Thu, 14 Jul 2011 15:32:50 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1447945249.1317755.1310627692984.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <4E1EAA72.1060103@redhat.com> <4E1EE183.5050100@codemonkey.ws> In-Reply-To: <4E1EE183.5050100@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] New thread for the VM migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Umesh Deshpande , qemu-devel@nongnu.org, kvm@vger.kernel.org On 07/14/2011 03:30 PM, Anthony Liguori wrote: >> Does this mean that the following code is sometimes executed without >> qemu_mutex? I don't think any of it is thread safe. > > > That was my reaction too. > > I think the most rational thing to do is have a separate thread and a > pair of producer/consumer queues. > > The I/O thread can push virtual addresses and sizes to the queue for > the migration thread to compress/write() to the fd. The migration > thread can then push sent regions onto a separate queue for the I/O > thread to mark as dirty. Even virtual addresses are not safe enough, because of hotunplug. Without some kind of locking, you have to copy the data. -- error compiling committee.c: too many arguments to function