From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Gregory Haskins <ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] interrupt preemption support
Date: Fri, 16 Mar 2007 09:03:40 +0200 [thread overview]
Message-ID: <45FA414C.1040703@qumranet.com> (raw)
In-Reply-To: <45F97019.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Gregory Haskins wrote:
> This patch adds baseline support for interrupt preemption. This lets one context (virtual SMP vcpu, PV driver, etc) preempt another vcpu which is currently in guest context when an interrupt is posted. The patch consists of the following:
>
> 1) Re-worked the vcpu mutex with a new "MPL" construct. This allows updates to the vcpu structure even if the vcpu is currently executing in guest mode. The previous code held a mutex during guest execution.
>
>
Whoa there. kvm can't just add new locking constructs to the kernel.
It has to be added to the kernel _first_, you need to justify it with
more than just kvm as a user, show correctness, performance, and
scalability.
Once it's accepted, kvm can use it.
Formal issues aside, why is this different from taking nested locks?
The paravirt network code congealing in Dor's repo has a spinlock
protecting the interrupt bits. The main execution path takes both the
vcpu mutex and the irq lock (when necessary), other paths take just the
irq lock. This has the added advantage of not requiring a mutex to
inject an interrupt, which is often necessary from (host) irq context.
> 2) Exposed the previously static kvm_vcpu_ioctl_interrupt() as kvm_vcpu_interrupt so that other mechanisms (PV drivers) can issue interrupts just as the ioctl interface can
>
It's not enough to issue an interrupt, there is a whole dance involved
in the guest side to ack it. You need to go through the apic, which is
currently emulated in userspace. We may push it to the kernel later.
>
> Index: kvm-12/kernel/kvm.h
>
Please base things off trunk. For kernel code, off the git repository,
not the bundled kernel module (which is mangled by the release process
in order to accommodate older kernels).
>
> +typedef enum
> +{
> + KVM_MPL_FREE,
> + KVM_MPL_VMCS,
> + KVM_MPL_VCPU,
> + KVM_MPL_FULL = KVM_MPL_VCPU /* Must be equal to the last entry */
> +}kvm_mpl_locktypes_t;
>
Either you or your mailer mangle whitespace horribly.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
next prev parent reply other threads:[~2007-03-16 7:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-15 21:10 [PATCH] interrupt preemption support Gregory Haskins
[not found] ` <45F97019.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-03-16 7:03 ` Avi Kivity [this message]
[not found] ` <45FA414C.1040703-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-16 12:17 ` Gregory Haskins
[not found] ` <45FA4489.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-03-18 5:46 ` Avi Kivity
[not found] ` <45FCD226.2010603-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-19 13:54 ` Gregory Haskins
[not found] ` <45FE4FB1.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-03-19 14:00 ` Avi Kivity
[not found] ` <45FE9793.3060204-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-19 14:03 ` Avi Kivity
[not found] ` <45FE9827.5030200-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-19 14:09 ` Gregory Haskins
[not found] ` <45FE5346.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-03-19 14:21 ` Avi Kivity
2007-03-28 22:05 ` Dor Laor
Reply instructions:
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45FA414C.1040703@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox