lkml.org 
[lkml]   [2011]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5] kvm: make vcpu life cycle separated from kvm instance
On 12/26/2011 01:09 PM, Gleb Natapov wrote:
> > +
> > + idx = srcu_read_lock(&kvm->srcu_vcpus);
> > + kvm_for_each_vcpu(vcpu, kvm) {
> > + if (!pass && !firststart &&
> > + vcpu != kvm->last_boosted_vcpu &&
> > + kvm->last_boosted_vcpu != NULL) {
> > + vcpu = kvm->last_boosted_vcpu;
> You access last_boosted_vcpu as if it is protected by srcu, but it
> isn't. kvm_vcpu_release() changes it after synchronize_srcu_expedited()
> call.
>
> I do not like this last_boosted_vcpu pointer much. May be we can rid of
> it by remembering last apic_id and searching for it each time we enter
> the function. I do not think this function is to performance sensitive.
> We enter here when vcpu is spinning anyway.

We aren't guaranteed to have an apic_id, so it has to be done using rcu,
or maybe vcpu_id. I prefer using srcu, we can't run away from vcpu
pointers.


--
error compiling committee.c: too many arguments to function



\
 
 \ /
  Last update: 2011-12-26 12:19    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog