WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 38 of 38] xen: make sure that softirqs get handled at

To: Ingo Molnar <mingo@xxxxxxx>
Subject: [Xen-devel] [PATCH 38 of 38] xen: make sure that softirqs get handled at the end of event processing
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Thu, 13 Nov 2008 11:10:36 -0800
Cc: the arch/x86 maintainers <x86@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Thu, 13 Nov 2008 11:56:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1226603398@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Make sure that irq_enter()/irq_exit() wrap the entire event processing
loop, rather than each individual event invokation.  This make sure
that softirq processing is deferred until the of event processing,
rather than in the middle with interrupts disabled.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 drivers/xen/events.c |   29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -806,25 +806,6 @@
        return IRQ_HANDLED;
 }
 
-
-static void xen_do_irq(unsigned irq, struct pt_regs *regs)
-{
-       struct pt_regs *old_regs = set_irq_regs(regs);
-
-       if (WARN_ON(irq == -1))
-               return;
-
-       exit_idle();
-       irq_enter();
-
-       //printk("cpu %d handling irq %d\n", smp_processor_id(), info->irq);
-       handle_irq(irq, regs);
-
-       irq_exit();
-
-       set_irq_regs(old_regs);
-}
-
 /*
  * Search the CPUs pending events bitmasks.  For each one found, map
  * the event number to an irq, and feed it into do_IRQ() for
@@ -837,11 +818,15 @@
 void xen_evtchn_do_upcall(struct pt_regs *regs)
 {
        int cpu = get_cpu();
+       struct pt_regs *old_regs = set_irq_regs(regs);
        struct shared_info *s = HYPERVISOR_shared_info;
        struct vcpu_info *vcpu_info = __get_cpu_var(xen_vcpu);
        static DEFINE_PER_CPU(unsigned, nesting_count);
        unsigned count;
 
+       exit_idle();
+       irq_enter();
+
        do {
                unsigned long pending_words;
 
@@ -865,7 +850,8 @@
                                int port = (word_idx * BITS_PER_LONG) + bit_idx;
                                int irq = evtchn_to_irq[port];
 
-                               xen_do_irq(irq, regs);
+                               if (irq != -1)
+                                       handle_irq(irq, regs);
                        }
                }
 
@@ -876,6 +862,9 @@
        } while(count != 1);
 
 out:
+       irq_exit();
+       set_irq_regs(old_regs);
+
        put_cpu();
 }
 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>