Re: KVM: x86: use smp_send_reschedule in kvm_vcpu_kick

Ingo Molnar
2009-03-09T10:59:06Z

* Avi Kivity <avi@redhat.com> wrote:

> Marcelo Tosatti wrote:
>> KVM uses a function call IPI to cause the exit of a guest running on a
>> physical cpu. For virtual interrupt notification there is no need to
>> wait on IPI receival, or to execute any function.
>>
>> This is exactly what the reschedule IPI does, without the overhead
>> of function IPI. So use it instead of smp_call_function_single in
>> kvm_vcpu_kick.
>>
>> Also change the "guest_mode" variable to a bit in vcpu->requests, and
>> use that to collapse multiple IPI's that would be issued between the
>> first one and zeroing of guest mode.
>>
>> This allows kvm_vcpu_kick to called from interrupt context.
>>
>
> Looks good. The only worry I have is that we depend on
> smp_reschedule_interrupt() being a no-op. I guess that's a
> reasonable assumption though.

It's a reasonable current assumption - but it might change in
the future - so please also put it into the changelog that KVM
will revert it or fix it differently if the scheduler grows some
functionality there.

Ingo