]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86/xen: prefer TSC over xen clocksource for dom0
authorPalik, Imre <imrep@amazon.de>
Tue, 13 Jan 2015 08:14:22 +0000 (09:14 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Tue, 20 Jan 2015 18:44:24 +0000 (18:44 +0000)
In Dom0's the use of the TSC clocksource (whenever it is stable enough to
be used) instead of the Xen clocksource should not cause any issues, as
Dom0 VMs never live-migrated.  The TSC clocksource is somewhat more
efficient than the Xen paravirtualised clocksource, thus it should have
higher rating.

This patch decreases the rating of the Xen clocksource in Dom0s to 275.
Which is half-way between the rating of the TSC clocksource (300) and the
hpet clocksource (250).

Cc: Anthony Liguori <aliguori@amazon.com>
Signed-off-by: Imre Palik <imrep@amazon.de>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/xen/time.c

index 69087341d9aed7860dfd95549c0a8af5ffbf1ed6..55da33b1d51cefdffa5a2ca013713e78849cc2e0 100644 (file)
@@ -479,6 +479,10 @@ static void __init xen_time_init(void)
        int cpu = smp_processor_id();
        struct timespec tp;
 
+       /* As Dom0 is never moved, no penalty on using TSC there */
+       if (xen_initial_domain())
+               xen_clocksource.rating = 275;
+
        clocksource_register_hz(&xen_clocksource, NSEC_PER_SEC);
 
        if (HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, cpu, NULL) == 0) {