Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c14280125a374d4c279a68276f97245e03e3f68
Commit:     6c14280125a374d4c279a68276f97245e03e3f68
Parent:     97db56ce6cc2a0766b536cc227a1da20acc5d82f
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 15 18:27:32 2008 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 18:01:22 2008 +0200

    KVM: Fix unbounded preemption latency
    
    When preparing to enter the guest, if an interrupt comes in while
    preemption is disabled but interrupts are still enabled, we miss a
    preemption point.  Fix by explicitly checking whether we need to
    reschedule.
    
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 arch/x86/kvm/x86.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 77d57ff..f0493e7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2535,6 +2535,13 @@ again:
 
        local_irq_disable();
 
+       if (need_resched()) {
+               local_irq_enable();
+               preempt_enable();
+               r = 1;
+               goto out;
+       }
+
        if (signal_pending(current)) {
                local_irq_enable();
                preempt_enable();
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to