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