]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/tsc.c
sched: optimize sched_clock() a bit
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / tsc.c
index 161bb850fc475b074524cfbba13fc161a4e6a439..424093b157d363dcad0bb58b8ed08636a9e0b61e 100644 (file)
@@ -55,7 +55,7 @@ u64 native_sched_clock(void)
        rdtscll(this_offset);
 
        /* return the value in ns */
-       return cycles_2_ns(this_offset);
+       return __cycles_2_ns(this_offset);
 }
 
 /* We need to define a real function for sched_clock, to override the
@@ -759,7 +759,7 @@ __cpuinit int unsynchronized_tsc(void)
        if (!cpu_has_tsc || tsc_unstable)
                return 1;
 
-#ifdef CONFIG_SMP
+#ifdef CONFIG_X86_SMP
        if (apic_is_clustered_box())
                return 1;
 #endif
@@ -813,10 +813,6 @@ void __init tsc_init(void)
                cpu_khz = calibrate_cpu();
 #endif
 
-       lpj = ((u64)tsc_khz * 1000);
-       do_div(lpj, HZ);
-       lpj_fine = lpj;
-
        printk("Detected %lu.%03lu MHz processor.\n",
                        (unsigned long)cpu_khz / 1000,
                        (unsigned long)cpu_khz % 1000);
@@ -836,6 +832,10 @@ void __init tsc_init(void)
        /* now allow native_sched_clock() to use rdtsc */
        tsc_disabled = 0;
 
+       lpj = ((u64)tsc_khz * 1000);
+       do_div(lpj, HZ);
+       lpj_fine = lpj;
+
        use_tsc_delay();
        /* Check and install the TSC clocksource */
        dmi_check_system(bad_tsc_dmi_table);