Re: [Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-28 Thread Avi Kivity
On 06/26/2014 05:31 PM, Etienne Martineau wrote: On 14-06-26 04:18 AM, Avi Kivity wrote: On 06/25/2014 08:53 PM, Etienne Martineau wrote: Hi, It seems to me that there is a scale issue O(n) in memory_region_transaction_commit(). It's actually O(n^3). Flatview is kept sorted but is just a v

Re: [Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-26 Thread Etienne Martineau
On 14-06-25 11:52 PM, Peter Crosthwaite wrote: > On Thu, Jun 26, 2014 at 4:58 AM, Paolo Bonzini wrote: >> Il 25/06/2014 19:53, Etienne Martineau ha scritto: >> >>> >>> It seems to me that there is a scale issue O(n) in >>> memory_region_transaction_commit(). >>> >>> Basically the time it takes to

Re: [Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-26 Thread Etienne Martineau
On 14-06-26 04:18 AM, Avi Kivity wrote: > > On 06/25/2014 08:53 PM, Etienne Martineau wrote: >> Hi, >> >> It seems to me that there is a scale issue O(n) in >> memory_region_transaction_commit(). > > It's actually O(n^3). Flatview is kept sorted but is just a vector, so if > you insert n regio

Re: [Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-26 Thread Avi Kivity
On 06/25/2014 08:53 PM, Etienne Martineau wrote: Hi, It seems to me that there is a scale issue O(n) in memory_region_transaction_commit(). It's actually O(n^3). Flatview is kept sorted but is just a vector, so if you insert n regions, you have n^2 operations. In addition every PCI device

Re: [Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-25 Thread Peter Crosthwaite
On Thu, Jun 26, 2014 at 4:58 AM, Paolo Bonzini wrote: > Il 25/06/2014 19:53, Etienne Martineau ha scritto: > >> >> It seems to me that there is a scale issue O(n) in >> memory_region_transaction_commit(). >> >> Basically the time it takes to rebuild the memory view during device >> assignment >> p

Re: [Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-25 Thread Etienne Martineau
On 14-06-25 02:58 PM, Paolo Bonzini wrote: > Il 25/06/2014 19:53, Etienne Martineau ha scritto: >> >> It seems to me that there is a scale issue O(n) in >> memory_region_transaction_commit(). >> >> Basically the time it takes to rebuild the memory view during device >> assignment >> pci_bridge_up

Re: [Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-25 Thread Paolo Bonzini
Il 25/06/2014 19:53, Etienne Martineau ha scritto: It seems to me that there is a scale issue O(n) in memory_region_transaction_commit(). Basically the time it takes to rebuild the memory view during device assignment pci_bridge_update_mappings() increase linearly with respect to the number of

[Qemu-devel] memory: memory_region_transaction_commit() slow

2014-06-25 Thread Etienne Martineau
Hi, It seems to me that there is a scale issue O(n) in memory_region_transaction_commit(). Basically the time it takes to rebuild the memory view during device assignment pci_bridge_update_mappings() increase linearly with respect to the number of device already assigned to the guest. I'm run