From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [Qemu-devel] [PATCH v2 0/8] nvdimm: hotplug support Date: Wed, 12 Oct 2016 18:19:56 +0800 Message-ID: References: <1470984850-66891-1-git-send-email-guangrong.xiao@linux.intel.com> <20161003154800.17e3ba30@nial.brq.redhat.com> <20161010145931.59c0c5bb@nial.brq.redhat.com> <560c2e37-ef5d-c0b0-0059-29d07cecd443@linux.intel.com> <20161011143223.666aba4a@nial.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, rth@twiddle.net To: Igor Mammedov Return-path: Received: from mga03.intel.com ([134.134.136.65]:30365 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932557AbcJLK0g (ORCPT ); Wed, 12 Oct 2016 06:26:36 -0400 In-Reply-To: <20161011143223.666aba4a@nial.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/11/2016 08:32 PM, Igor Mammedov wrote: >> >> Of course, @fit and @current_number should be persistent during live migration. > you can drop RCU and @current_number, > and @fit could be exactly recreated on target side from > -device nvdim ... > set of options, which must include all currently present > (including hotplugged) devices from source side. > > It's sufficient to invalidate and restart DMA transfer in flight. > > i.e. > pc_dimm_memory_plug () > -> regenerate_fit() > -> set local flag @fit-dirty > > -> start QEMU.fit_read() > -> if offset == 0 ? clear @fit-dirty > make sure fit_read() won't conflict with regenerate_fit() > either plain mutex or RCU would do the job > > ... > OSPM.rfit() > ... > if (@fit-dirty) > abort/restart DMA from start > > In migration case, the target would have @fit-dirty set thanks to > pc_dimm_memory_plug () -> regenerate_fit() and any DMA in flight > would be restarted. > That's a little bit inefficient as source_fit exactly matches > target_fit and DMA could continue, but it would save us from > having fit specific migration state to transfer and maintain. > Nice, that works. :-) Thanks!