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] linux/x86: fix long timeout handling

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] linux/x86: fix long timeout handling in stop_hz_timer()
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Feb 2010 02:15:24 -0800
Delivery-date: Mon, 22 Feb 2010 02:16:23 -0800
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 1266832998 0
# Node ID ff275dae07eecb5bbcd99cc0f8cb9fd41d400145
# Parent  05a04247f0576a71dc4d897d0b03cbfd4c2ed57b
linux/x86: fix long timeout handling in stop_hz_timer()

Other than for HYPERVISOR_set_timer_op, zero doesn't mean "no timeout"
for VCPUOP_set_singleshot_timer (but should be retained rather than
adjusted by NS_PER_TICK/2 for the former).

Also properly cancel the singleshot timer is start_hz_timer().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 arch/i386/kernel/time-xen.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff -r 05a04247f057 -r ff275dae07ee arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c       Mon Feb 15 17:44:01 2010 +0000
+++ b/arch/i386/kernel/time-xen.c       Mon Feb 22 10:03:18 2010 +0000
@@ -1022,7 +1022,10 @@ static void stop_hz_timer(void)
                j = jiffies + 1;
        }
 
-       singleshot.timeout_abs_ns = jiffies_to_st(j) + NS_PER_TICK/2;
+       singleshot.timeout_abs_ns = jiffies_to_st(j);
+       if (!singleshot.timeout_abs_ns)
+               return;
+       singleshot.timeout_abs_ns += NS_PER_TICK / 2;
        singleshot.flags = 0;
        rc = HYPERVISOR_vcpu_op(VCPUOP_set_singleshot_timer, cpu, &singleshot);
 #if CONFIG_XEN_COMPAT <= 0x030004
@@ -1036,7 +1039,17 @@ static void stop_hz_timer(void)
 
 static void start_hz_timer(void)
 {
-       cpu_clear(smp_processor_id(), nohz_cpu_mask);
+       unsigned int cpu = smp_processor_id();
+       int rc = HYPERVISOR_vcpu_op(VCPUOP_stop_singleshot_timer, cpu, NULL);
+
+#if CONFIG_XEN_COMPAT <= 0x030004
+       if (rc) {
+               BUG_ON(rc != -ENOSYS);
+               rc = HYPERVISOR_set_timer_op(0);
+       }
+#endif
+       BUG_ON(rc);
+       cpu_clear(cpu, nohz_cpu_mask);
 }
 
 void raw_safe_halt(void)

_______________________________________________
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] linux/x86: fix long timeout handling in stop_hz_timer(), Xen patchbot-linux-2.6.18-xen <=