On 2017/5/20 0:46, Paolo Bonzini wrote: > > > On 19/05/2017 14:17, Gonglei (Arei) wrote: >>> It would. Right now memory_region_transaction_commit() is roughly >>> O(n^2) (n devices * n BARs), and there are n of them. >>> >>> Reducing memory_region_transaction_commit to O(n) would be a large >>> change. One idea is to share the AddressSpaceDispatch for AddressSpaces >>> that have the same root memory region (after resolving aliases). The >>> starting point would be to change mem_begin/mem_commit/mem_add from a >>> MemoryListener to an loop on the FlatView, storing the >>> AddressSpaceDispatch in the FlatView. >>> >> How about do O(1) for stopping stage of live migration? >> Because the cpu is stopped in this phase, it wouldn't cause >> side effects IMHO, right? > > O(1) update is probably not quite possible, but it's possible to do one > O(n) update. We tried doing that, but something in virtio broke.
How were you do that? did you put extra begin/commit before/after destination guest load, so that the destination guest only do one update(of n devs) throughout the whole migration? > I > don't remember the details. > > Paolo > -- Thanks, Yang