From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGQxG-0004E6-7B for qemu-devel@nongnu.org; Tue, 05 Jan 2016 07:43:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGQxD-00077w-0g for qemu-devel@nongnu.org; Tue, 05 Jan 2016 07:43:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGQxC-00077s-Pu for qemu-devel@nongnu.org; Tue, 05 Jan 2016 07:43:10 -0500 Date: Tue, 5 Jan 2016 12:43:03 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20160105124303.GE2439@work-vm> References: <20151213212557.5410.48577.stgit@localhost.localdomain> <20160104204104.GB17427@char.us.oracle.com> <20160105113317-mutt-send-email-mst@redhat.com> <20160105100104.GA2439@work-vm> <20160105123243-mutt-send-email-mst@redhat.com> <20160105104525.GC2439@work-vm> <20160105130133-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160105130133-mutt-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Lan Tianyu , Yang Zhang , Alex Williamson , kvm@vger.kernel.org, Konrad Rzeszutek Wilk , "linux-pci@vger.kernel.org" , x86@kernel.org, "linux-kernel@vger.kernel.org" , Alexander Duyck , qemu-devel@nongnu.org, Alexander Graf , Alexander Duyck * Michael S. Tsirkin (mst@redhat.com) wrote: > On Tue, Jan 05, 2016 at 10:45:25AM +0000, Dr. David Alan Gilbert wrote: > > * Michael S. Tsirkin (mst@redhat.com) wrote: > > > On Tue, Jan 05, 2016 at 10:01:04AM +0000, Dr. David Alan Gilbert wrote: > > > > * Michael S. Tsirkin (mst@redhat.com) wrote: > > > > > On Mon, Jan 04, 2016 at 07:11:25PM -0800, Alexander Duyck wrote: > > > > > > >> The two mechanisms referenced above would likely require coordination with > > > > > > >> QEMU and as such are open to discussion. I haven't attempted to address > > > > > > >> them as I am not sure there is a consensus as of yet. My personal > > > > > > >> preference would be to add a vendor-specific configuration block to the > > > > > > >> emulated pci-bridge interfaces created by QEMU that would allow us to > > > > > > >> essentially extend shpc to support guest live migration with pass-through > > > > > > >> devices. > > > > > > > > > > > > > > shpc? > > > > > > > > > > > > That is kind of what I was thinking. We basically need some mechanism > > > > > > to allow for the host to ask the device to quiesce. It has been > > > > > > proposed to possibly even look at something like an ACPI interface > > > > > > since I know ACPI is used by QEMU to manage hot-plug in the standard > > > > > > case. > > > > > > > > > > > > - Alex > > > > > > > > > > > > > > > Start by using hot-unplug for this! > > > > > > > > > > Really use your patch guest side, and write host side > > > > > to allow starting migration with the device, but > > > > > defer completing it. > > > > > > > > > > So > > > > > > > > > > 1.- host tells guest to start tracking memory writes > > > > > 2.- guest acks > > > > > 3.- migration starts > > > > > 4.- most memory is migrated > > > > > 5.- host tells guest to eject device > > > > > 6.- guest acks > > > > > 7.- stop vm and migrate rest of state > > > > > > > > > > > > > > > It will already be a win since hot unplug after migration starts and > > > > > most memory has been migrated is better than hot unplug before migration > > > > > starts. > > > > > > > > > > Then measure downtime and profile. Then we can look at ways > > > > > to quiesce device faster which really means step 5 is replaced > > > > > with "host tells guest to quiesce device and dirty (or just unmap!) > > > > > all memory mapped for write by device". > > > > > > > > > > > > Doing a hot-unplug is going to upset the guests network stacks view > > > > of the world; that's something we don't want to change. > > > > > > > > Dave > > > > > > It might but if you store the IP and restore it quickly > > > after migration e.g. using guest agent, as opposed to DHCP, > > > then it won't. > > > > I thought if you hot-unplug then it will lose any outstanding connections > > on that device. > > Which connections and which device? TCP connections and an ethernet > device? These are on different layers so of course you don't lose them. > Just do not change the IP address. > > Some guests send a signal to applications to close connections > when all links go down. One can work around this > in a variety of ways. So, OK, I was surprised that a simple connection didn't go down when I tested and just removed the network card; I'd thought stuff was more aggressive when there was no route. But as you say, some stuff does close connections when the links go down/away so we do need to work around that; and any new outgoing connections get a 'no route to host'. So I'm still nervous what will break. Dave > > > > It allows calming the device down in a generic way, > > > specific drivers can then implement the fast quiesce. > > > > Except that if it breaks the guest networking it's useless. > > > > Dave > > > > > > > > > > > > > > > -- > > > > > MST > > > > -- > > > > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > > -- > > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK