Re: [PATCH] KVM breaks CPU hotplug

Li, Shaohua
2007-03-27T01:12:07Z

>-----Original Message-----
>From: Avi Kivity [mailto:avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org]
>Sent: Monday, March 26, 2007 6:58 PM
>To: Li, Shaohua
>Cc: kvm-devel; Andrew Morton
>Subject: Re: [PATCH] KVM breaks CPU hotplug
>
>Avi Kivity wrote:
>> Shaohua Li wrote:
>>> When testing CPU hotplug, I found cpu can't be onlined with kvm
enabled
>>> sometimes. The reason is smp_call_function_single is a nop if the
thread
>>> is running on the target cpu. I think CPU_ONLINE case doesn't
require
>>> the fix as the online CPU isn't plugged into sheduler yet.
>>>
>>>
>>
>> I think this is not enough, because:
>>
>> - this path is preemptible code, so the test (this_cpu == cpu) can
run
>> one on cpu and execute later code on another
>>> + this_cpu = get_cpu();
>
>...
>
>>> + put_cpu();
>
>Sorry, I see you handled that. But the other argument (scheduling
vcpus
>later on same cpu) still holds, I think.
How about take cpu hotplug lock for kvm_vm_ioctl and kvm_vcpu_ioctl?

Thanks,
Shaohua