diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-02-18 20:53:43 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-02-21 21:11:22 +0100 |
commit | c25323c07345a843a56a294047b130dfd9250fad (patch) | |
tree | 2035f870ded37d3908632c17299caa2dbef76648 /arch/x86/kernel/tsc.c | |
parent | 81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff) |
x86/tsc: Use topology functions
It's simpler to look at the topology mask than iterating over all online cpus
to find a cpu on the same package.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r-- | arch/x86/kernel/tsc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 3d743da828d3..5a6cb4684e0f 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1246,14 +1246,14 @@ void __init tsc_init(void) */ unsigned long calibrate_delay_is_known(void) { - int i, cpu = smp_processor_id(); + int sibling, cpu = smp_processor_id(); if (!tsc_disabled && !cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC)) return 0; - for_each_online_cpu(i) - if (cpu_data(i).phys_proc_id == cpu_data(cpu).phys_proc_id) - return cpu_data(i).loops_per_jiffy; + sibling = cpumask_any_but(topology_core_cpumask(cpu), cpu); + if (sibling < nr_cpu_ids) + return cpu_data(sibling).loops_per_jiffy; return 0; } #endif |