Re: [PATCH RFC 2/2] KVM: RCU protected dynamic vcpus array

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 18:50, Radim Krčmář wrote: > 2017-08-17 13:14+0200, David Hildenbrand: >>> atomic_set(&kvm->online_vcpus, 0); >>> mutex_unlock(&kvm->lock); >>> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h >>> index c8df733eed41..eb9fb5b493ac 100644 >>> --- a/include/linux/

Re: [PATCH RFC 2/2] KVM: RCU protected dynamic vcpus array

2017-08-17 Thread Radim Krčmář
2017-08-17 13:14+0200, David Hildenbrand: > > atomic_set(&kvm->online_vcpus, 0); > > mutex_unlock(&kvm->lock); > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index c8df733eed41..eb9fb5b493ac 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host

Re: [PATCH RFC 2/2] KVM: RCU protected dynamic vcpus array

2017-08-17 Thread David Hildenbrand
> atomic_set(&kvm->online_vcpus, 0); > mutex_unlock(&kvm->lock); > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index c8df733eed41..eb9fb5b493ac 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -386,12 +386,17 @@ struct kvm_memslots {

Re: [PATCH RFC 2/2] KVM: RCU protected dynamic vcpus array

2017-08-17 Thread Cornelia Huck
On Wed, 16 Aug 2017 21:40:37 +0200 Radim Krčmář wrote: > This is a prototype with many TODO comments to give a better idea of > what would be needed. Just a very superficial reading... > > The main missing piece a rework of every kvm_for_each_vcpu() into a less > inefficient loop, but RCU read

[PATCH RFC 2/2] KVM: RCU protected dynamic vcpus array

2017-08-16 Thread Radim Krčmář
This is a prototype with many TODO comments to give a better idea of what would be needed. The main missing piece a rework of every kvm_for_each_vcpu() into a less inefficient loop, but RCU readers cannot block, so the rewrite cannot be scripted. Is there a more suitable protection scheme? I di