Blame SOURCES/irqbalance-1.0.8-Balance-correctly-IRQs-reappearing.patch

5f346f
From 93ed80181e0ce7b81bc88a67fabad1ad829fc460 Mon Sep 17 00:00:00 2001
5f346f
From: Frediano Ziglio <frediano.ziglio@citrix.com>
5f346f
Date: Wed, 2 Jul 2014 12:59:34 +0100
5f346f
Subject: [PATCH 1/1] Balance correctly IRQs reappearing
5f346f
5f346f
If IRQ disappears and reappears later (this happens frequently for Xen)
5f346f
the IRQ is not balanced correctly due to overflow in irq_count (as the
5f346f
counter got smaller and difference cause overflow).
5f346f
Rescan if this happens fix the problem.
5f346f
5f346f
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
5f346f
---
5f346f
 procinterrupts.c | 8 ++++++++
5f346f
 1 file changed, 8 insertions(+)
5f346f
5f346f
diff --git a/procinterrupts.c b/procinterrupts.c
5f346f
index 6a6bdaa..3476473 100644
5f346f
--- a/procinterrupts.c
5f346f
+++ b/procinterrupts.c
5f346f
@@ -181,6 +181,14 @@ void parse_proc_interrupts(void)
5f346f
 			break;
5f346f
 		}
5f346f
 
5f346f
+		/* IRQ removed and reinserted, need restart or this will
5f346f
+		 * cause an overflow and IRQ won't be rebalanced again
5f346f
+		 */
5f346f
+		if (count < info->irq_count) {
5f346f
+			need_rescan = 1;
5f346f
+			break;
5f346f
+		}
5f346f
+
5f346f
 		info->last_irq_count = info->irq_count;		
5f346f
 		info->irq_count = count;
5f346f
 
5f346f
-- 
5f346f
2.16.1
5f346f