From: Gerd H. <kr...@re...> - 2008-05-07 18:45:24
|
Marcelo Tosatti wrote: > On Thu, Apr 24, 2008 at 10:37:04AM +0200, Gerd Hoffmann wrote: >> Hi folks, >> >> My first attempt to send out a patch series with git ... >> >> The patches fix the kvm paravirt clocksource code to be compatible with >> xen and they also factor out some code which can be shared into a >> separate source files used by both kvm and xen. > > The issue with SMP guests is still present. Booting with "nohz=off" resolves it. > > Same symptoms as before, apic_timer_fn for one of the vcpu's is ticking way slower > than the remaining ones: > > [root@localhost ~]# cat /proc/timer_stats | grep apic > 391, 4125 qemu-system-x86 apic_mmio_write (apic_timer_fn) > 2103, 4126 qemu-system-x86 apic_mmio_write (apic_timer_fn) > 1896, 4127 qemu-system-x86 apic_mmio_write (apic_timer_fn) > 1857, 4128 qemu-system-x86 apic_mmio_write (apic_timer_fn) > > Let me know what else is needed, or any patches to try. Ok folks, here is the band aid fix for testing from the odd bugs department. Goes on top of the four patches of this series. A real, clean solution is TBD. Tomorrow I hope (some urgent private problems are in the queue too ...). Problem is the per-cpu area for cpu 0 has two locations in memory, one before and one after pda initialization. kvmclock registers the first due to being initialized quite early, and the paravirt clock for cpu 0 stops seeing updates once the pda setup is done. Which makes the TSC effectively the base for timekeeping (instead of using the TSC for millisecond delta adjustments only). Secondary CPUs work as intended. This obviously screws up timekeeping on SMP guests, especially on hosts with unstable TSC. happy testing, Gerd -- [root@localhost ~]# dmesg | grep _clock kvm_register_clock: cpu 0 at 0:798601 (boot) kvm_clock_read: cpu 0 at 0:140b601 (pda) kvm_register_clock: cpu 1 at 0:1415601 |