From: Peter Zijlstra <email@example.com>
To: Ingo Molnar <firstname.lastname@example.org>
Cc: Avi Kivity <email@example.com>,
Marcelo Tosatti <firstname.lastname@example.org>,
email@example.com, Gleb Natapov <firstname.lastname@example.org>,
Peter Zijlstra <email@example.com>
Subject: Re: KVM: x86: use smp_send_reschedule in kvm_vcpu_kick
Date: Mon, 09 Mar 2009 12:09:06 +0100 [thread overview]
Message-ID: <1236596946.8389.340.camel@laptop> (raw)
On Mon, 2009-03-09 at 11:58 +0100, Ingo Molnar wrote:
> * Avi Kivity <firstname.lastname@example.org> 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.
Alternatively, do something like the below, then anybody poking at that
code will know to prod the KVM folks when they change anything.
[ I suspect other kvm arches will need to a similar comment ]
arch/x86/kernel/smp.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 13f33ea..3b2e55e 100644
@@ -172,6 +172,9 @@ void smp_reschedule_interrupt(struct pt_regs *regs)
+ * KVM uses this interrupt to force a cpu out of guest mode
void smp_call_function_interrupt(struct pt_regs *regs)
next prev parent reply other threads:[~2009-03-09 11:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 0:14 KVM: x86: use smp_send_reschedule in kvm_vcpu_kick Marcelo Tosatti
2009-03-03 7:53 ` Zhang, Xiantao
2009-03-03 13:25 ` Marcelo Tosatti
2009-03-03 13:25 ` Gleb Natapov
2009-03-03 13:56 ` Marcelo Tosatti
2009-03-09 10:17 ` KVM: " Avi Kivity
2009-03-09 10:58 ` Ingo Molnar
2009-03-09 11:09 ` Peter Zijlstra [this message]
2009-03-09 23:23 ` Marcelo Tosatti
2009-03-10 8:01 ` Avi Kivity
2009-03-12 2:31 ` Zhang, Xiantao
2009-03-12 7:06 ` Avi Kivity
2009-03-12 11:04 ` Gleb Natapov
2009-03-13 2:15 ` Zhang, Xiantao
2009-03-19 7:38 ` Gleb Natapov
2009-03-19 7:56 ` Zhang, Xiantao
2009-03-19 8:11 ` Gleb Natapov
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.