From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiNyO-0004i4-7z for qemu-devel@nongnu.org; Thu, 08 May 2014 09:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiNyF-0002UG-Rd for qemu-devel@nongnu.org; Thu, 08 May 2014 09:02:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiNyF-0002UA-K0 for qemu-devel@nongnu.org; Thu, 08 May 2014 09:02:43 -0400 Date: Thu, 8 May 2014 18:32:31 +0530 From: Amit Shah Message-ID: <20140508130231.GA24978@grmbl.mre> References: <53693FA4.3000306@windriver.com> <5369D504.2070101@redhat.com> <536AB2EE.6010504@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <536AB2EE.6010504@windriver.com> Subject: Re: [Qemu-devel] virtio-serial-pci very expensive during live migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Friesen Cc: Paolo Bonzini , qemu-devel@nongnu.org, armbru@redhat.com On (Wed) 07 May 2014 [16:25:50], Chris Friesen wrote: > On 05/07/2014 12:39 AM, Paolo Bonzini wrote: > >Il 06/05/2014 22:01, Chris Friesen ha scritto: > >> > >>It seems like the main problem is that we loop over all the queues, > >>calling virtio_pci_set_host_notifier_internal() on each of them. That > >>in turn calls memory_region_add_eventfd(), which calls > >>memory_region_transaction_commit(), which scans over all the address > >>spaces, which seems to take the vast majority of the time. > > > >Yes, you can wrap the entire loop with memory_region_transaction_begin > >and memory_region_transaction_commit. Can you try that? > > I tried the patch below. Unfortunately it seems to cause qemu to crash. This doesn't remove the memory_region_transaction_begin() and _commit() from memory_region_add_eventfd(), which will still be called. Also, if you're not using all 32 ports, you can restrict the max number of ports for a device using the virtio-serial-pci.max_ports=uint32 property: -device virtio-serial-pci,max_ports=2 Amit