]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
Make last processed event channel a per-cpu variable.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 3 Dec 2007 08:50:12 +0000 (08:50 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 3 Dec 2007 08:50:12 +0000 (08:50 +0000)
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
drivers/xen/core/evtchn.c

index 546c7b70aabf1142208aedf5533afbfbfb595522..afd187d689fa08199511b3c135e0b319e60d1ec8 100644 (file)
@@ -221,6 +221,8 @@ void force_evtchn_callback(void)
 EXPORT_SYMBOL(force_evtchn_callback);
 
 static DEFINE_PER_CPU(unsigned int, upcall_count) = { 0 };
+static DEFINE_PER_CPU(unsigned int, last_processed_l1i) = { BITS_PER_LONG - 1 };
+static DEFINE_PER_CPU(unsigned int, last_processed_l2i) = { BITS_PER_LONG - 1 };
 
 /* NB. Interrupts are disabled on entry. */
 asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
@@ -228,7 +230,6 @@ asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
        unsigned long       l1, l2;
        unsigned long       masked_l1, masked_l2;
        unsigned int        l1i, l2i, port, count;
-       static unsigned int last_processed_l1i = BITS_PER_LONG - 1, last_processed_l2i = BITS_PER_LONG - 1;
        int                 irq, cpu = smp_processor_id();
        shared_info_t      *s = HYPERVISOR_shared_info;
        vcpu_info_t        *vcpu_info = &s->vcpu_info[cpu];
@@ -248,8 +249,8 @@ asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
 #endif
                l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
 
-               l1i = last_processed_l1i;
-               l2i = last_processed_l2i;
+               l1i = per_cpu(last_processed_l1i, cpu);
+               l2i = per_cpu(last_processed_l2i, cpu);
 
                while (l1 != 0) {
 
@@ -286,8 +287,8 @@ asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
                                }
 
                                /* if this is the final port processed, we'll pick up here+1 next time */
-                               last_processed_l1i = l1i;
-                               last_processed_l2i = l2i;
+                               per_cpu(last_processed_l1i, cpu) = l1i;
+                               per_cpu(last_processed_l2i, cpu) = l2i;
 
                        } while (l2i != BITS_PER_LONG - 1);