[PATCH 3/5] Do not wait till next cpu online and abort early if lead cpu do not wait for us anymore

From: Igor Mammedov
Date: Wed May 09 2012 - 04:28:18 EST


Use cpu_callout_mask for checking if boot cpu is still waiting on us

Signed-off-by: Igor Mammedov <imammedo@xxxxxxxxxx>
---
arch/x86/kernel/tsc_sync.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index 5f06138..1741385 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -188,10 +188,13 @@ void __cpuinit check_tsc_sync_target(void)
/*
* Wait for the source CPU to start the measurement
*/
- while (!atomic_read(&start_tsc_sync))
+ while (!atomic_read(&start_tsc_sync)) {
+ if (!cpumask_test_cpu(smp_processor_id(), cpu_callout_mask))
+ return;
cpu_relax();
+ }

- if (!cpumask_test_cpu(smp_processor_id(), cpu_initialized_mask))
+ if (!cpumask_test_cpu(smp_processor_id(), cpu_callout_mask))
return;

atomic_set(&start_tsc_sync, 0);
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/