ia64/xen-unstable

changeset 18474:f5e72cbfbb17

x86: Fix calibration rendezvous for cpu hotplug.

Need to latch cpu_online_map.

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Sep 10 11:26:16 2008 +0100 (2008-09-10)
parents 706844309f36
children e5766aea2907
files xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/time.c	Wed Sep 10 11:18:36 2008 +0100
     1.2 +++ b/xen/arch/x86/time.c	Wed Sep 10 11:26:16 2008 +0100
     1.3 @@ -993,15 +993,16 @@ static void local_time_calibration(void)
     1.4   * All CPUS snapshot their local TSC and extrapolation of system time.
     1.5   */
     1.6  struct calibration_rendezvous {
     1.7 +    cpumask_t cpu_calibration_map;
     1.8      atomic_t nr_cpus;
     1.9      s_time_t master_stime;
    1.10  };
    1.11  
    1.12  static void time_calibration_rendezvous(void *_r)
    1.13  {
    1.14 -    unsigned int total_cpus = num_online_cpus();
    1.15      struct cpu_calibration *c = &this_cpu(cpu_calibration);
    1.16      struct calibration_rendezvous *r = _r;
    1.17 +    unsigned int total_cpus = cpus_weight(r->cpu_calibration_map);
    1.18  
    1.19      if ( smp_processor_id() == 0 )
    1.20      {
    1.21 @@ -1029,11 +1030,13 @@ static void time_calibration_rendezvous(
    1.22  static void time_calibration(void *unused)
    1.23  {
    1.24      struct calibration_rendezvous r = {
    1.25 +        .cpu_calibration_map = cpu_online_map,
    1.26          .nr_cpus = ATOMIC_INIT(0)
    1.27      };
    1.28  
    1.29      /* @wait=1 because we must wait for all cpus before freeing @r. */
    1.30 -    on_each_cpu(time_calibration_rendezvous, &r, 0, 1);
    1.31 +    on_selected_cpus(r.cpu_calibration_map,
    1.32 +                     time_calibration_rendezvous, &r, 0, 1);
    1.33  }
    1.34  
    1.35  void init_percpu_time(void)