Re: [PATCH v6] kvm: make vcpu life cycle separated from kvm instance

From: Liu ping fan
Date: Thu Dec 29 2011 - 09:03:06 EST


On Wed, Dec 28, 2011 at 5:53 PM, Avi Kivity <avi@xxxxxxxxxx> wrote:
> On 12/28/2011 08:54 AM, Liu ping fan wrote:
>> >>
>> >> Â struct kvm_vcpu {
>> >> Â Â Â struct kvm *kvm;
>> >> + Â Â struct list_head list;
>> >> Â #ifdef CONFIG_PREEMPT_NOTIFIERS
>> >> Â Â Â struct preempt_notifier preempt_notifier;
>> >> Â #endif
>> >> @@ -251,12 +252,14 @@ struct kvm {
>> >> Â Â Â struct mm_struct *mm; /* userspace tied to this vm */
>> >> Â Â Â struct kvm_memslots *memslots;
>> >> Â Â Â struct srcu_struct srcu;
>> >> + Â Â struct srcu_struct srcu_vcpus;
>> >> +
>> >
>> > Another srcu. ÂThis alone is worth explaining in the changelog IMO.
>> >
>> Sorry, but why? I think it is just a srcu, and because it has
>> different aim and want a independent grace period, so not multiplex
>> kvm->srcu.
>
> There is Documentation/virtual/kvm/locking.txt for that.
>
> btw, why does it have to be srcu? ÂIs rcu insufficient?
>
Just to survive from "if (yield_to(task, 1)) in kvm_vcpu_on_spin()",

> Why do we want an independent grace period, is hotunplugging a vcpu that
> much different from hotunplugging memory?
>
I thought that if less readers on the same srcu lock, then
synchronize_srcu_expedited() may success to return more quickly.

Thanks and regards,
ping fan
> --
> error compiling committee.c: too many arguments to function
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/