[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: time_calibration_rendezvous must be invoked with @wait=1.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1219926709 -3600
# Node ID a37902923a67ca9c251cfff4038f01f48dd21558
# Parent  b674d71595497d85a19508664f8d4b442481b0ab
x86: time_calibration_rendezvous must be invoked with @wait=1.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/time.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r b674d7159549 -r a37902923a67 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Thu Aug 28 13:09:02 2008 +0100
+++ b/xen/arch/x86/time.c       Thu Aug 28 13:31:49 2008 +0100
@@ -1008,6 +1008,7 @@ static void time_calibration_rendezvous(
         while ( atomic_read(&r->nr_cpus) != (total_cpus - 1) )
             cpu_relax();
         r->master_stime = read_platform_stime();
+        mb(); /* write r->master_stime /then/ signal */
         atomic_inc(&r->nr_cpus);
     }
     else
@@ -1015,6 +1016,7 @@ static void time_calibration_rendezvous(
         atomic_inc(&r->nr_cpus);
         while ( atomic_read(&r->nr_cpus) != total_cpus )
             cpu_relax();
+        mb(); /* receive signal /then/ read r->master_stime */
     }
 
     rdtscll(c->local_tsc_stamp);
@@ -1030,7 +1032,8 @@ static void time_calibration(void *unuse
         .nr_cpus = ATOMIC_INIT(0)
     };
 
-    on_each_cpu(time_calibration_rendezvous, &r, 0, 0);
+    /* @wait=1 because we must wait for all cpus before freeing @r. */
+    on_each_cpu(time_calibration_rendezvous, &r, 0, 1);
 }
 
 void init_percpu_time(void)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.