Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread Peter Xu
On Wed, Sep 04, 2024 at 05:46:55PM -0400, Peter Xu wrote: > On Wed, Sep 04, 2024 at 11:38:28PM +0200, David Hildenbrand wrote: > > On 04.09.24 23:34, Peter Xu wrote: > > > On Wed, Sep 04, 2024 at 11:23:33PM +0200, David Hildenbrand wrote: > > > > > > > > > > > > > > > > Then, you can remove the p

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread Peter Xu
On Wed, Sep 04, 2024 at 11:38:28PM +0200, David Hildenbrand wrote: > On 04.09.24 23:34, Peter Xu wrote: > > On Wed, Sep 04, 2024 at 11:23:33PM +0200, David Hildenbrand wrote: > > > > > > > > > > > > > Then, you can remove the parameter from kvm_slots_grow() completely > > > > > and just call it

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread David Hildenbrand
On 04.09.24 23:34, Peter Xu wrote: On Wed, Sep 04, 2024 at 11:23:33PM +0200, David Hildenbrand wrote: Then, you can remove the parameter from kvm_slots_grow() completely and just call it kvm_slots_double() and simplify a bit: static bool kvm_slots_double(KVMMemoryListener *kml) { unsi

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread Peter Xu
On Wed, Sep 04, 2024 at 11:23:33PM +0200, David Hildenbrand wrote: > > > > > > > Then, you can remove the parameter from kvm_slots_grow() completely and > > > just call it > > > kvm_slots_double() and simplify a bit: > > > > > > static bool kvm_slots_double(KVMMemoryListener *kml) > > > { > > >

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread David Hildenbrand
Then, you can remove the parameter from kvm_slots_grow() completely and just call it kvm_slots_double() and simplify a bit: static bool kvm_slots_double(KVMMemoryListener *kml) { unsigned int i, nr_slots_new, cur = kml->nr_slots_allocated; KVMSlot *slots; nr_slots_new = MIN(c

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread Peter Xu
On Wed, Sep 04, 2024 at 11:07:44PM +0200, David Hildenbrand wrote: > On 04.09.24 21:16, Peter Xu wrote: > > Zhiyi reported an infinite loop issue in VFIO use case. The cause of that > > was a separate discussion, however during that I found a regression of > > dirty sync slowness when profiling. >

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread David Hildenbrand
On 04.09.24 21:16, Peter Xu wrote: Zhiyi reported an infinite loop issue in VFIO use case. The cause of that was a separate discussion, however during that I found a regression of dirty sync slowness when profiling. Each KVMMemoryListerner maintains an array of kvm memslots. Currently it's sta

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread Peter Xu
On Wed, Sep 04, 2024 at 10:43:23PM +0200, David Hildenbrand wrote: > On 04.09.24 21:16, Peter Xu wrote: > > Zhiyi reported an infinite loop issue in VFIO use case. The cause of that > > was a separate discussion, however during that I found a regression of > > dirty sync slowness when profiling. >

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread David Hildenbrand
On 04.09.24 22:43, David Hildenbrand wrote: On 04.09.24 21:16, Peter Xu wrote: Zhiyi reported an infinite loop issue in VFIO use case. The cause of that was a separate discussion, however during that I found a regression of dirty sync slowness when profiling. Each KVMMemoryListerner maintains

Re: [PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread David Hildenbrand
On 04.09.24 21:16, Peter Xu wrote: Zhiyi reported an infinite loop issue in VFIO use case. The cause of that was a separate discussion, however during that I found a regression of dirty sync slowness when profiling. Each KVMMemoryListerner maintains an array of kvm memslots. Currently it's sta

[PATCH 3/4] KVM: Dynamic sized kvm memslots array

2024-09-04 Thread Peter Xu
Zhiyi reported an infinite loop issue in VFIO use case. The cause of that was a separate discussion, however during that I found a regression of dirty sync slowness when profiling. Each KVMMemoryListerner maintains an array of kvm memslots. Currently it's statically allocated to be the max suppo