[kernel/f13/master] Copy two Xen fixes from 2.6.35-stable for RHBZ#636534
Chuck Ebbert
cebbert at fedoraproject.org
Wed Sep 22 16:15:43 UTC 2010
commit 084d5cbca74c8fe5c8df35e77730029d1a61e0b0
Author: Chuck Ebbert <cebbert at redhat.com>
Date: Wed Sep 22 12:14:45 2010 -0400
Copy two Xen fixes from 2.6.35-stable for RHBZ#636534
kernel.spec | 11 +++
xen-handle-events-as-edge-triggered.patch | 44 ++++++++++++
xen-use-percpu-interrupts-for-ipis-and-virqs.patch | 73 ++++++++++++++++++++
3 files changed, 128 insertions(+), 0 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 9d0c226..0ead450 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -811,6 +811,10 @@ Patch12560: tracing-do-not-allow-llseek-to-set_ftrace_filter.patch
Patch12570: sched-00-fix-user-time-incorrectly-accounted-as-system-time-on-32-bit.patch
+# bz 636534
+Patch12580: xen-handle-events-as-edge-triggered.patch
+Patch12581: xen-use-percpu-interrupts-for-ipis-and-virqs.patch
+
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1533,6 +1537,10 @@ ApplyPatch tracing-do-not-allow-llseek-to-set_ftrace_filter.patch
# BZ 633037
ApplyPatch sched-00-fix-user-time-incorrectly-accounted-as-system-time-on-32-bit.patch
+# BZ 636534
+ApplyPatch xen-handle-events-as-edge-triggered.patch
+ApplyPatch xen-use-percpu-interrupts-for-ipis-and-virqs.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -2154,6 +2162,9 @@ fi
%changelog
+* Wed Sep 22 2010 Chuck Ebbert <cebbert at redhat.com>
+- Copy two Xen fixes from 2.6.35-stable for RHBZ#636534
+
* Tue Sep 21 2010 Chuck Ebbert <cebbert at redhat.com>
- Fix RHBZ #633037, Process user time incorrectly accounted as system time
diff --git a/xen-handle-events-as-edge-triggered.patch b/xen-handle-events-as-edge-triggered.patch
new file mode 100644
index 0000000..dd06bbf
--- /dev/null
+++ b/xen-handle-events-as-edge-triggered.patch
@@ -0,0 +1,44 @@
+From dffe2e1e1a1ddb566a76266136c312801c66dcf7 Mon Sep 17 00:00:00 2001
+From: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+Date: Fri, 20 Aug 2010 19:10:01 -0700
+Subject: xen: handle events as edge-triggered
+
+From: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+
+commit dffe2e1e1a1ddb566a76266136c312801c66dcf7 upstream.
+
+Xen events are logically edge triggered, as Xen only calls the event
+upcall when an event is newly set, but not continuously as it remains set.
+As a result, use handle_edge_irq rather than handle_level_irq.
+
+This has the important side-effect of fixing a long-standing bug of
+events getting lost if:
+ - an event's interrupt handler is running
+ - the event is migrated to a different vcpu
+ - the event is re-triggered
+
+The most noticable symptom of these lost events is occasional lockups
+of blkfront.
+
+Many thanks to Tom Kopec and Daniel Stodden in tracking this down.
+
+Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+Cc: Tom Kopec <tek at acm.org>
+Cc: Daniel Stodden <daniel.stodden at citrix.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+
+---
+ drivers/xen/events.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/xen/events.c
++++ b/drivers/xen/events.c
+@@ -363,7 +363,7 @@ int bind_evtchn_to_irq(unsigned int evtc
+ irq = find_unbound_irq();
+
+ set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
+- handle_level_irq, "event");
++ handle_edge_irq, "event");
+
+ evtchn_to_irq[evtchn] = irq;
+ irq_info[irq] = mk_evtchn_info(evtchn);
diff --git a/xen-use-percpu-interrupts-for-ipis-and-virqs.patch b/xen-use-percpu-interrupts-for-ipis-and-virqs.patch
new file mode 100644
index 0000000..646f92c
--- /dev/null
+++ b/xen-use-percpu-interrupts-for-ipis-and-virqs.patch
@@ -0,0 +1,73 @@
+From aaca49642b92c8a57d3ca5029a5a94019c7af69f Mon Sep 17 00:00:00 2001
+From: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+Date: Fri, 20 Aug 2010 18:57:53 -0700
+Subject: xen: use percpu interrupts for IPIs and VIRQs
+
+From: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+
+commit aaca49642b92c8a57d3ca5029a5a94019c7af69f upstream.
+
+IPIs and VIRQs are inherently per-cpu event types, so treat them as such:
+ - use a specific percpu irq_chip implementation, and
+ - handle them with handle_percpu_irq
+
+This makes the path for delivering these interrupts more efficient
+(no masking/unmasking, no locks), and it avoid problems with attempts
+to migrate them.
+
+Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+
+---
+ drivers/xen/events.c | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+--- a/drivers/xen/events.c
++++ b/drivers/xen/events.c
+@@ -107,6 +107,7 @@ static inline unsigned long *cpu_evtchn_
+ #define VALID_EVTCHN(chn) ((chn) != 0)
+
+ static struct irq_chip xen_dynamic_chip;
++static struct irq_chip xen_percpu_chip;
+
+ /* Constructor for packed IRQ information. */
+ static struct irq_info mk_unbound_info(void)
+@@ -389,8 +390,8 @@ static int bind_ipi_to_irq(unsigned int
+ if (irq < 0)
+ goto out;
+
+- set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
+- handle_level_irq, "ipi");
++ set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
++ handle_percpu_irq, "ipi");
+
+ bind_ipi.vcpu = cpu;
+ if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
+@@ -430,8 +431,8 @@ static int bind_virq_to_irq(unsigned int
+
+ irq = find_unbound_irq();
+
+- set_irq_chip_and_handler_name(irq, &xen_dynamic_chip,
+- handle_level_irq, "virq");
++ set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
++ handle_percpu_irq, "virq");
+
+ evtchn_to_irq[evtchn] = irq;
+ irq_info[irq] = mk_virq_info(evtchn, virq);
+@@ -934,6 +935,16 @@ static struct irq_chip xen_dynamic_chip
+ .retrigger = retrigger_dynirq,
+ };
+
++static struct irq_chip en_percpu_chip __read_mostly = {
++ .name = "xen-percpu",
++
++ .disable = disable_dynirq,
++ .mask = disable_dynirq,
++ .unmask = enable_dynirq,
++
++ .ack = ack_dynirq,
++};
++
+ void __init xen_init_IRQ(void)
+ {
+ int i;
More information about the scm-commits
mailing list