Merge "Fix imprecise timer interrupts by eliminating TSC clockevents frequency round...
authorJiang, Yunhong <yunhong.jiang@intel.com>
Fri, 28 Oct 2016 23:29:05 +0000 (23:29 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 28 Oct 2016 23:29:05 +0000 (23:29 +0000)
kernel/arch/x86/kernel/apic/apic.c

index 2f69e3b..d2eee3e 100644 (file)
@@ -305,7 +305,7 @@ int lapic_get_maxlvt(void)
 
 /* Clock divisor */
 #define APIC_DIVISOR 16
-#define TSC_DIVISOR  32
+#define TSC_DIVISOR  8
 
 /*
  * This function sets up the local APIC timer, with a timeout of
@@ -557,7 +557,7 @@ static void setup_APIC_timer(void)
                                    CLOCK_EVT_FEAT_DUMMY);
                levt->set_next_event = lapic_next_deadline;
                clockevents_config_and_register(levt,
-                                               (tsc_khz / TSC_DIVISOR) * 1000,
+                                               tsc_khz * (1000 / TSC_DIVISOR),
                                                0xF, ~0UL);
        } else
                clockevents_register_device(levt);