From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2GoF-0002Ww-DP for qemu-devel@nongnu.org; Fri, 27 Nov 2015 06:03:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2GoB-0004Zm-I9 for qemu-devel@nongnu.org; Fri, 27 Nov 2015 06:03:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2GoB-0004Zc-D6 for qemu-devel@nongnu.org; Fri, 27 Nov 2015 06:03:19 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id D0F3714CACD for ; Fri, 27 Nov 2015 11:03:18 +0000 (UTC) Date: Fri, 27 Nov 2015 19:03:07 +0800 From: Peter Xu Message-ID: <20151127110304.GA10191@pxdev.xzpeter.org> References: <1448592497-2462-1-git-send-email-peterx@redhat.com> <1448592497-2462-4-git-send-email-peterx@redhat.com> <20151127051425.GC14568@ad.usersys.redhat.com> <5657F7C7.1010909@redhat.com> <56582CF9.9070602@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56582CF9.9070602@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 3/8] dump-guest-memory: add basic "detach" support. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Fam Zheng , qemu-devel@nongnu.org On Fri, Nov 27, 2015 at 11:14:17AM +0100, Paolo Bonzini wrote: > > > On 27/11/2015 07:27, Peter Xu wrote: > > If embed the mr pointer into GuestPhyBlock, then we might need to > > ref/unref one MemoryRegion for multiple times (and I am not sure how > > many, maybe it could be a very big number especially the > > MemoryRegionSections are scattered?). Not sure whether it is more > > efficient. > > > > For what I see, the number of MemoryRegions should be not big (<5 in > > my case). So even with O(N^2), it should merely like O(N). Not sure > > about this too. > > > > Would like to hear more review comments from Paolo and others. > > > > Fam suggestion is a good one, ref'ing one MemoryRegion many times is not > a problem. Ok, then I will embed the MemoryRegion pointer into GuestPhysBlocks in v3. > > Also I noticed now that you do the dump_init in the main thread (using a > listener), so the RCU lock/unlock is not needed. I don't know this code > very well. Yes, it's in main thread too in v1 patch, since I think that should not be the time consuming part. If so, I will remove the RCU lock/unlock too. > > It's worth adding a comment at the top of functions that are called from > a separate thread. Ok. Will add that. Thanks! Peter > > Thanks, > > Paolo