From: Keir Fraser Date: Wed, 10 Sep 2008 10:26:16 +0000 (+0100) Subject: x86: Fix calibration rendezvous for cpu hotplug. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14111^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7dbee4c5cd2cd00838be92eff210dfe9f30fd487;p=xen.git x86: Fix calibration rendezvous for cpu hotplug. Need to latch cpu_online_map. From: Haitao Shan Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 9bdd920c10..2459e9738c 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -993,15 +993,16 @@ static void local_time_calibration(void) * All CPUS snapshot their local TSC and extrapolation of system time. */ struct calibration_rendezvous { + cpumask_t cpu_calibration_map; atomic_t nr_cpus; s_time_t master_stime; }; static void time_calibration_rendezvous(void *_r) { - unsigned int total_cpus = num_online_cpus(); struct cpu_calibration *c = &this_cpu(cpu_calibration); struct calibration_rendezvous *r = _r; + unsigned int total_cpus = cpus_weight(r->cpu_calibration_map); if ( smp_processor_id() == 0 ) { @@ -1029,11 +1030,13 @@ static void time_calibration_rendezvous(void *_r) static void time_calibration(void *unused) { struct calibration_rendezvous r = { + .cpu_calibration_map = cpu_online_map, .nr_cpus = ATOMIC_INIT(0) }; /* @wait=1 because we must wait for all cpus before freeing @r. */ - on_each_cpu(time_calibration_rendezvous, &r, 0, 1); + on_selected_cpus(r.cpu_calibration_map, + time_calibration_rendezvous, &r, 0, 1); } void init_percpu_time(void)