From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YumiD-0005pT-KR for qemu-devel@nongnu.org; Tue, 19 May 2015 14:57:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yumi9-0007eX-HT for qemu-devel@nongnu.org; Tue, 19 May 2015 14:57:57 -0400 Received: from e18.ny.us.ibm.com ([129.33.205.208]:41312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yumi9-0007e5-7v for qemu-devel@nongnu.org; Tue, 19 May 2015 14:57:53 -0400 Received: from /spool/local by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 May 2015 14:57:52 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 2BEF96E803C for ; Tue, 19 May 2015 14:49:37 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4JIvnRl57868364 for ; Tue, 19 May 2015 18:57:49 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4JIvmbu017109 for ; Tue, 19 May 2015 14:57:48 -0400 Message-ID: <555B87B6.9010701@linux.vnet.ibm.com> Date: Tue, 19 May 2015 13:57:58 -0500 From: "Michael R. Hines" MIME-Version: 1.0 References: <1429545445-28216-1-git-send-email-dgilbert@redhat.com> <1429545445-28216-5-git-send-email-dgilbert@redhat.com> <555B80DE.5030403@linux.vnet.ibm.com> <20150519184409.GF2127@work-vm> In-Reply-To: <20150519184409.GF2127@work-vm> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/10] Translate offsets to destination address space List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: amit.shah@redhat.com, quintela@redhat.com, arei.gonglei@huawei.com, qemu-devel@nongnu.org, mrhines@us.ibm.com On 05/19/2015 01:44 PM, Dr. David Alan Gilbert wrote: > * Michael R. Hines (mrhines@linux.vnet.ibm.com) wrote: >> On 04/20/2015 10:57 AM, Dr. David Alan Gilbert (git) wrote: >>> From: "Dr. David Alan Gilbert" >>> >>> The 'offset' field in RDMACompress and 'current_addr' field >>> in RDMARegister are commented as being offsets within a particular >>> RAMBlock, however they appear to actually be offsets within the >>> ram_addr_t space. >>> >>> The code currently assumes that the offsets on the source/destination >>> match, this change removes the need for the assumption for these >>> structures by translating the addresses into the ram_addr_t space of >>> the destination host. >> I don't understand fully: If the offsets are not the same, then >> why would the RAMBlocks be the same? If a RAMBlock >> is hot-plugged on one side, shouldn't an identical one be >> hotplugged on the other side, including the offset into ram_addr_t? > If a RAMBlock is hotplugged on the source, it's normally passed in on > the command line at startup on the destination, not hotplugged. > > This difference in order of allocation of the RAMBlocks can cause > the allocation of space in ram_addr_t to be different. > > In addition changes between qemu versions as to the order in which > devices are initialised can cause differences in the allocation in ram_addr_t. > > Indeed the allocation algorithm isn't very deterministic, I think it looks > for the smallest gap that will fit for the allocation. > Also, lets say that you hot plugged 6 devices, and hot unplugged 5, > then migrated; on the destination you only see one of them, not the history > of the other allocations that had to be performed. I see ---- so until now, I just got "lucky" that the RAMBlocks were in the same order with the same offsets =).