Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-18 Thread Marc Zyngier
On 18/08/17 15:10, Radim Krčmář wrote: > 2017-08-17 21:17+0200, Alexander Graf: >> On 17.08.17 16:54, Radim Krčmář wrote: >>> 2017-08-17 09:04+0200, Alexander Graf: What if we just sent a "vcpu move" request to all vcpus with the new pointer after it moved? That way the vcpu thread

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-18 Thread Marc Zyngier
On 18/08/17 15:10, Radim Krčmář wrote: > 2017-08-17 21:17+0200, Alexander Graf: >> On 17.08.17 16:54, Radim Krčmář wrote: >>> 2017-08-17 09:04+0200, Alexander Graf: What if we just sent a "vcpu move" request to all vcpus with the new pointer after it moved? That way the vcpu thread

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-18 Thread Radim Krčmář
2017-08-17 21:17+0200, Alexander Graf: > On 17.08.17 16:54, Radim Krčmář wrote: > > 2017-08-17 09:04+0200, Alexander Graf: > > > What if we just sent a "vcpu move" request to all vcpus with the new > > > pointer > > > after it moved? That way the vcpu thread itself would be responsible for > > >

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-18 Thread Radim Krčmář
2017-08-17 21:17+0200, Alexander Graf: > On 17.08.17 16:54, Radim Krčmář wrote: > > 2017-08-17 09:04+0200, Alexander Graf: > > > What if we just sent a "vcpu move" request to all vcpus with the new > > > pointer > > > after it moved? That way the vcpu thread itself would be responsible for > > >

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Alexander Graf
On 17.08.17 16:54, Radim Krčmář wrote: 2017-08-17 09:04+0200, Alexander Graf: On 16.08.17 21:40, Radim Krčmář wrote: The goal is to increase KVM_MAX_VCPUS without worrying about memory impact of many small guests. This is a second out of three major "dynamic" options: 1) size vcpu array

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Alexander Graf
On 17.08.17 16:54, Radim Krčmář wrote: 2017-08-17 09:04+0200, Alexander Graf: On 16.08.17 21:40, Radim Krčmář wrote: The goal is to increase KVM_MAX_VCPUS without worrying about memory impact of many small guests. This is a second out of three major "dynamic" options: 1) size vcpu array

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Radim Krčmář
2017-08-17 09:04+0200, Alexander Graf: > On 16.08.17 21:40, Radim Krčmář wrote: > > The goal is to increase KVM_MAX_VCPUS without worrying about memory > > impact of many small guests. > > > > This is a second out of three major "dynamic" options: > > 1) size vcpu array at VM creation time > >

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Radim Krčmář
2017-08-17 09:04+0200, Alexander Graf: > On 16.08.17 21:40, Radim Krčmář wrote: > > The goal is to increase KVM_MAX_VCPUS without worrying about memory > > impact of many small guests. > > > > This is a second out of three major "dynamic" options: > > 1) size vcpu array at VM creation time > >

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 17.08.2017 12:23, Paolo Bonzini wrote: > On 17/08/2017 12:20, David Hildenbrand wrote: >> On 17.08.2017 12:18, Paolo Bonzini wrote: >>> On 17/08/2017 11:55, David Hildenbrand wrote: On 17.08.2017 11:44, Paolo Bonzini wrote: > On 17/08/2017 11:28, Cornelia Huck wrote: >> On Thu, 17

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 17.08.2017 12:23, Paolo Bonzini wrote: > On 17/08/2017 12:20, David Hildenbrand wrote: >> On 17.08.2017 12:18, Paolo Bonzini wrote: >>> On 17/08/2017 11:55, David Hildenbrand wrote: On 17.08.2017 11:44, Paolo Bonzini wrote: > On 17/08/2017 11:28, Cornelia Huck wrote: >> On Thu, 17

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 12:20, David Hildenbrand wrote: > On 17.08.2017 12:18, Paolo Bonzini wrote: >> On 17/08/2017 11:55, David Hildenbrand wrote: >>> On 17.08.2017 11:44, Paolo Bonzini wrote: On 17/08/2017 11:28, Cornelia Huck wrote: > On Thu, 17 Aug 2017 11:16:59 +0200 > Paolo Bonzini

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 12:20, David Hildenbrand wrote: > On 17.08.2017 12:18, Paolo Bonzini wrote: >> On 17/08/2017 11:55, David Hildenbrand wrote: >>> On 17.08.2017 11:44, Paolo Bonzini wrote: On 17/08/2017 11:28, Cornelia Huck wrote: > On Thu, 17 Aug 2017 11:16:59 +0200 > Paolo Bonzini

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 17.08.2017 12:18, Paolo Bonzini wrote: > On 17/08/2017 11:55, David Hildenbrand wrote: >> On 17.08.2017 11:44, Paolo Bonzini wrote: >>> On 17/08/2017 11:28, Cornelia Huck wrote: On Thu, 17 Aug 2017 11:16:59 +0200 Paolo Bonzini wrote: > On 17/08/2017

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 17.08.2017 12:18, Paolo Bonzini wrote: > On 17/08/2017 11:55, David Hildenbrand wrote: >> On 17.08.2017 11:44, Paolo Bonzini wrote: >>> On 17/08/2017 11:28, Cornelia Huck wrote: On Thu, 17 Aug 2017 11:16:59 +0200 Paolo Bonzini wrote: > On 17/08/2017 09:36, Cornelia Huck

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 11:55, David Hildenbrand wrote: > On 17.08.2017 11:44, Paolo Bonzini wrote: >> On 17/08/2017 11:28, Cornelia Huck wrote: >>> On Thu, 17 Aug 2017 11:16:59 +0200 >>> Paolo Bonzini wrote: >>> On 17/08/2017 09:36, Cornelia Huck wrote: >> What if we just

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 11:55, David Hildenbrand wrote: > On 17.08.2017 11:44, Paolo Bonzini wrote: >> On 17/08/2017 11:28, Cornelia Huck wrote: >>> On Thu, 17 Aug 2017 11:16:59 +0200 >>> Paolo Bonzini wrote: >>> On 17/08/2017 09:36, Cornelia Huck wrote: >> What if we just sent a "vcpu move"

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 17.08.2017 11:44, Paolo Bonzini wrote: > On 17/08/2017 11:28, Cornelia Huck wrote: >> On Thu, 17 Aug 2017 11:16:59 +0200 >> Paolo Bonzini wrote: >> >>> On 17/08/2017 09:36, Cornelia Huck wrote: > What if we just sent a "vcpu move" request to all vcpus with the new

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 17.08.2017 11:44, Paolo Bonzini wrote: > On 17/08/2017 11:28, Cornelia Huck wrote: >> On Thu, 17 Aug 2017 11:16:59 +0200 >> Paolo Bonzini wrote: >> >>> On 17/08/2017 09:36, Cornelia Huck wrote: > What if we just sent a "vcpu move" request to all vcpus with the new > pointer after it

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 11:28, Cornelia Huck wrote: > On Thu, 17 Aug 2017 11:16:59 +0200 > Paolo Bonzini wrote: > >> On 17/08/2017 09:36, Cornelia Huck wrote: What if we just sent a "vcpu move" request to all vcpus with the new pointer after it moved? That way the vcpu

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 11:28, Cornelia Huck wrote: > On Thu, 17 Aug 2017 11:16:59 +0200 > Paolo Bonzini wrote: > >> On 17/08/2017 09:36, Cornelia Huck wrote: What if we just sent a "vcpu move" request to all vcpus with the new pointer after it moved? That way the vcpu thread itself would be

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Cornelia Huck
On Thu, 17 Aug 2017 11:16:59 +0200 Paolo Bonzini wrote: > On 17/08/2017 09:36, Cornelia Huck wrote: > >> What if we just sent a "vcpu move" request to all vcpus with the new > >> pointer after it moved? That way the vcpu thread itself would be > >> responsible for the

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Cornelia Huck
On Thu, 17 Aug 2017 11:16:59 +0200 Paolo Bonzini wrote: > On 17/08/2017 09:36, Cornelia Huck wrote: > >> What if we just sent a "vcpu move" request to all vcpus with the new > >> pointer after it moved? That way the vcpu thread itself would be > >> responsible for the migration to the new

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 09:36, Cornelia Huck wrote: >> What if we just sent a "vcpu move" request to all vcpus with the new >> pointer after it moved? That way the vcpu thread itself would be >> responsible for the migration to the new memory region. Only if all >> vcpus successfully moved, keep rolling

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 09:36, Cornelia Huck wrote: >> What if we just sent a "vcpu move" request to all vcpus with the new >> pointer after it moved? That way the vcpu thread itself would be >> responsible for the migration to the new memory region. Only if all >> vcpus successfully moved, keep rolling

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Cornelia Huck
On Thu, 17 Aug 2017 09:29:51 +0200 David Hildenbrand wrote: > As Alex said, doubling the size every time we run out of space could be > done. > > I clearly favor a solution that doesn't require user space changes. +1 to both of this.

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Cornelia Huck
On Thu, 17 Aug 2017 09:29:51 +0200 David Hildenbrand wrote: > As Alex said, doubling the size every time we run out of space could be > done. > > I clearly favor a solution that doesn't require user space changes. +1 to both of this.

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Cornelia Huck
On Thu, 17 Aug 2017 09:04:14 +0200 Alexander Graf wrote: > On 16.08.17 21:40, Radim Krčmář wrote: > > The goal is to increase KVM_MAX_VCPUS without worrying about memory > > impact of many small guests. > > > > This is a second out of three major "dynamic" options: > > 1) size

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Cornelia Huck
On Thu, 17 Aug 2017 09:04:14 +0200 Alexander Graf wrote: > On 16.08.17 21:40, Radim Krčmář wrote: > > The goal is to increase KVM_MAX_VCPUS without worrying about memory > > impact of many small guests. > > > > This is a second out of three major "dynamic" options: > > 1) size vcpu array at

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 16.08.2017 21:40, Radim Krčmář wrote: > The goal is to increase KVM_MAX_VCPUS without worrying about memory > impact of many small guests. > > This is a second out of three major "dynamic" options: > 1) size vcpu array at VM creation time > 2) resize vcpu array when new VCPUs are created >

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread David Hildenbrand
On 16.08.2017 21:40, Radim Krčmář wrote: > The goal is to increase KVM_MAX_VCPUS without worrying about memory > impact of many small guests. > > This is a second out of three major "dynamic" options: > 1) size vcpu array at VM creation time > 2) resize vcpu array when new VCPUs are created >

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Alexander Graf
On 16.08.17 21:40, Radim Krčmář wrote: The goal is to increase KVM_MAX_VCPUS without worrying about memory impact of many small guests. This is a second out of three major "dynamic" options: 1) size vcpu array at VM creation time 2) resize vcpu array when new VCPUs are created 3) use a

Re: [PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-17 Thread Alexander Graf
On 16.08.17 21:40, Radim Krčmář wrote: The goal is to increase KVM_MAX_VCPUS without worrying about memory impact of many small guests. This is a second out of three major "dynamic" options: 1) size vcpu array at VM creation time 2) resize vcpu array when new VCPUs are created 3) use a

[PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-16 Thread Radim Krčmář
The goal is to increase KVM_MAX_VCPUS without worrying about memory impact of many small guests. This is a second out of three major "dynamic" options: 1) size vcpu array at VM creation time 2) resize vcpu array when new VCPUs are created 3) use a lockless list/tree for VCPUs The disadvantage

[PATCH RFC 0/2] KVM: use RCU to allow dynamic kvm->vcpus array

2017-08-16 Thread Radim Krčmář
The goal is to increase KVM_MAX_VCPUS without worrying about memory impact of many small guests. This is a second out of three major "dynamic" options: 1) size vcpu array at VM creation time 2) resize vcpu array when new VCPUs are created 3) use a lockless list/tree for VCPUs The disadvantage