diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-03-03 04:29:36 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-03-10 14:47:56 -0500 |
commit | f1f4a323d46c90632a4d35d34f1d347ca7cb65f5 (patch) | |
tree | ce2643d300c77c12c94ea5688a7f9dc8fc3effeb /drivers/xen/events.c | |
parent | ab7f863e4183057dc494f3180199934a9637d401 (diff) |
xen: events: Make last processed event channel a per-cpu variable.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
[ijc: forward ported from linux-2.6.18-xen.hg 325:b2768401db94]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r-- | drivers/xen/events.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 75cc6f50bd29..1fc3192468ef 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -1026,6 +1026,8 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id) | |||
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | static DEFINE_PER_CPU(unsigned, xed_nesting_count); | 1028 | static DEFINE_PER_CPU(unsigned, xed_nesting_count); |
1029 | static DEFINE_PER_CPU(unsigned int, last_word_idx) = { BITS_PER_LONG - 1 }; | ||
1030 | static DEFINE_PER_CPU(unsigned int, last_bit_idx) = { BITS_PER_LONG - 1 }; | ||
1029 | 1031 | ||
1030 | /* | 1032 | /* |
1031 | * Mask out the i least significant bits of w | 1033 | * Mask out the i least significant bits of w |
@@ -1043,8 +1045,6 @@ static DEFINE_PER_CPU(unsigned, xed_nesting_count); | |||
1043 | */ | 1045 | */ |
1044 | static void __xen_evtchn_do_upcall(void) | 1046 | static void __xen_evtchn_do_upcall(void) |
1045 | { | 1047 | { |
1046 | static unsigned int last_word_idx = BITS_PER_LONG - 1; | ||
1047 | static unsigned int last_bit_idx = BITS_PER_LONG - 1; | ||
1048 | int word_idx, bit_idx; | 1048 | int word_idx, bit_idx; |
1049 | int cpu = get_cpu(); | 1049 | int cpu = get_cpu(); |
1050 | struct shared_info *s = HYPERVISOR_shared_info; | 1050 | struct shared_info *s = HYPERVISOR_shared_info; |
@@ -1065,8 +1065,8 @@ static void __xen_evtchn_do_upcall(void) | |||
1065 | #endif | 1065 | #endif |
1066 | pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0); | 1066 | pending_words = xchg(&vcpu_info->evtchn_pending_sel, 0); |
1067 | 1067 | ||
1068 | word_idx = last_word_idx; | 1068 | word_idx = __this_cpu_read(last_word_idx); |
1069 | bit_idx = last_bit_idx; | 1069 | bit_idx = __this_cpu_read(last_bit_idx); |
1070 | 1070 | ||
1071 | while (pending_words != 0) { | 1071 | while (pending_words != 0) { |
1072 | unsigned long pending_bits; | 1072 | unsigned long pending_bits; |
@@ -1121,9 +1121,8 @@ static void __xen_evtchn_do_upcall(void) | |||
1121 | * If this is the final port processed, we'll | 1121 | * If this is the final port processed, we'll |
1122 | * pick up here+1 next time. | 1122 | * pick up here+1 next time. |
1123 | */ | 1123 | */ |
1124 | last_word_idx = word_idx; | 1124 | __this_cpu_write(last_word_idx, word_idx); |
1125 | last_bit_idx = bit_idx; | 1125 | __this_cpu_write(last_bit_idx, bit_idx); |
1126 | |||
1127 | } while (bit_idx != BITS_PER_LONG - 1); | 1126 | } while (bit_idx != BITS_PER_LONG - 1); |
1128 | 1127 | ||
1129 | pending_bits = active_evtchns(cpu, s, word_idx); | 1128 | pending_bits = active_evtchns(cpu, s, word_idx); |