Skip to content

Commit

Permalink
x86/tsc: Use topology functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner committed Feb 21, 2016
1 parent 81f70ba commit c25323c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/x86/kernel/tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c25323c

Please sign in to comment.