From 1edd52371027124d77b9f1336c317cc801eac0f0 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 3 Dec 2007 08:50:12 +0000 Subject: [PATCH] Make last processed event channel a per-cpu variable. Signed-off-by: Ian Campbell --- drivers/xen/core/evtchn.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/xen/core/evtchn.c b/drivers/xen/core/evtchn.c index 546c7b70..afd187d6 100644 --- a/drivers/xen/core/evtchn.c +++ b/drivers/xen/core/evtchn.c @@ -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); -- 2.39.5