[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49EBB96F.60300@goop.org>
Date: Sun, 19 Apr 2009 16:53:19 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Avi Kivity <avi@...hat.com>
CC: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Nick Piggin <nickpiggin@...oo.com.au>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] Allow preemption during lazy mmu updates
Avi Kivity wrote:
> What are the slight differences in requirements?
>
> KVM wants to run in non-preemptible, interrupts-enabled context.
There are two hooks: arch_start_context_switch() in
kernel/sched:context_switch(), and arch_end_context_switch() in
arch/x86/kernel/process_(32|64).c. They bound the heart of the context
switch in which various bits of core state is changes, like the cr3
reload, fpu TS flag, iopl, tls slots, etc. All things which require a
hypercall in a paravirtualized environment, and so can be batched
together into a multicall (or whatever) to minimize the number of
context-switch time hypercalls. The placement of end_context_switch is
particularly sensitive because it needs to be in the right place
relative to fpu context reload and segment register reloading.
Preemption is definitely disabled, and interrupts as well, I think. So
perhaps these won't work for you.
However, looking at the fire_sched_out_preempt_notifiers() is almost in
the same position as arch_start_context_switch(), so I think they could
be unified one way or the other. The sched_in notifier happens way too
late though. Does KVM just use both in and out, or just one?
J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists