WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/evtchn: Handle VIRQ_TIMER before

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/evtchn: Handle VIRQ_TIMER before any other hardirq in event loop.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Sep 2010 02:30:11 -0700
Delivery-date: Wed, 22 Sep 2010 02:30:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1285147542 -3600
# Node ID a66a7c64b1d039fe4012a26164bbbbdc14727d61
# Parent  2146cf82c90c48ddc191728f3136a1db098b6c71
xen/evtchn: Handle VIRQ_TIMER before any other hardirq in event loop.

This avoids any other hardirq handler seeing a very stale jiffies
value immediately after wakeup from a long idle period. The one
observable symptom of this was a USB keyboard, with software keyboard
repeat, which would always repeat a key immediately that it was
pressed. This is due to the key press waking the guest, the key
handler immediately runs, sees an old jiffies value, and then that
jiffies value significantly updated, before the key is unpressed.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 drivers/xen/core/evtchn.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

diff -r 2146cf82c90c -r a66a7c64b1d0 drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c Wed Sep 22 08:57:21 2010 +0100
+++ b/drivers/xen/core/evtchn.c Wed Sep 22 10:25:42 2010 +0100
@@ -259,6 +259,20 @@ asmlinkage void evtchn_do_upcall(struct 
                /* Clear master flag /before/ clearing selector flag. */
                wmb();
 #endif
+
+               /*
+                * Handle timer interrupts before all others, so that all
+                * hardirq handlers see an up-to-date system time even if we
+                * have just woken from a long idle period.
+                */
+               if ((irq = __get_cpu_var(virq_to_irq)[VIRQ_TIMER]) != -1) {
+                       port = evtchn_from_irq(irq);
+                       l1i = port / BITS_PER_LONG;
+                       l2i = port % BITS_PER_LONG;
+                       if (active_evtchns(cpu, s, l1i) & (1ul<<l2i))
+                               do_IRQ(irq, regs);
+               }
+
                l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
 
                start_l1i = l1i = per_cpu(current_l1i, cpu);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/evtchn: Handle VIRQ_TIMER before any other hardirq in event loop., Xen patchbot-linux-2.6.18-xen <=