From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751570AbcFFJSo (ORCPT ); Mon, 6 Jun 2016 05:18:44 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:5803 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751025AbcFFJSm (ORCPT ); Mon, 6 Jun 2016 05:18:42 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="7402100" Subject: Re: Re: [Qemu-devel] [RFC PATCH 0/3] x86: Add support for guest DMA dirty page tracking To: Alexander Duyck , "Michael S. Tsirkin" References: <20151213212557.5410.48577.stgit@localhost.localdomain> <20160104204104.GB17427@char.us.oracle.com> <20160105113317-mutt-send-email-mst@redhat.com> CC: Lan Tianyu , Yang Zhang , Alex Williamson , , Konrad Rzeszutek Wilk , "linux-pci@vger.kernel.org" , , "linux-kernel@vger.kernel.org" , , Alexander Graf , Alexander Duyck , "Dr. David Alan Gilbert" From: Zhou Jie Message-ID: Date: Mon, 6 Jun 2016 17:18:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-yoursite-MailScanner-ID: 407A74338599.AC58E X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: zhoujie2011@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 2016/1/6 0:18, Alexander Duyck wrote: > On Tue, Jan 5, 2016 at 1:40 AM, Michael S. Tsirkin 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. > > Yeah, I'm fully on board with this idea, though I'm not really working > on this right now since last I knew the folks on this thread from > Intel were working on it. My patches were mostly meant to be a nudge > in this direction so that we could get away from the driver specific > code. I have seen your email about live migration. I conclude the idea you proposed as following. 1. Extend swiotlb to allow for a page dirtying functionality. 2. Use pci express capability to implement of a PCI bridge to act as a bridge between direct assigned devices and the host bridge. 3. Using APCI event or extend shpc driver to support device pause. Is it right? Will you implement the patchs for live migration? Sincerely, Zhou Jie > >> 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 >> > > Sounds about right. The only way this differs from what I see as the > final solution for this is that instead of fully ejecting the device > in step 5 the driver would instead pause the device and give the host > something like 10 seconds to stop the VM and resume with the same > device connected if it is available. We would probably also need to > look at a solution that would force the device to be ejected or abort > prior to starting the migration if it doesn't give us the ack in step > 2. > >> 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. > > Right. Generally the longer the VF can be maintained as a part of the > guest the longer the network performance is improved versus using a > purely virtual interface. > >> 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". > > Step 5 will be the spot where we really need to start modifying > drivers. Specifically we probably need to go through and clean-up > things so that we can reduce as many of the delays in the driver > suspend/resume path as possible. I suspect there is quite a bit that > can be done there that would probably also improve boot and shutdown > times since those are also impacted by the devices. > > - Alex > > > > . >