From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751910AbcAEJkP (ORCPT ); Tue, 5 Jan 2016 04:40:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42619 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbcAEJkI (ORCPT ); Tue, 5 Jan 2016 04:40:08 -0500 Date: Tue, 5 Jan 2016 11:40:03 +0200 From: "Michael S. Tsirkin" To: Alexander Duyck Cc: Konrad Rzeszutek Wilk , Alexander Duyck , kvm@vger.kernel.org, "linux-pci@vger.kernel.org" , x86@kernel.org, "linux-kernel@vger.kernel.org" , qemu-devel@nongnu.org, Lan Tianyu , Yang Zhang , "Dr. David Alan Gilbert" , Alexander Graf , Alex Williamson Subject: Re: [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking Message-ID: <20160105113317-mutt-send-email-mst@redhat.com> References: <20151213212557.5410.48577.stgit@localhost.localdomain> <20160104204104.GB17427@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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". -- MST