Re: Clock not moving in virtual machine

From: Rob Farmer <rfarmer_at_predatorlabs.net>
Date: Fri, 16 Jul 2010 12:31:10 -0700
On Thu, Jul 15, 2010 at 11:33 PM, Alexander Motin <mav_at_freebsd.org> wrote:
> Rob Farmer wrote:
>> I have a VPS from rootbsd.net which is running current, though I don't
>> update it very often. I just built and installed a new world and
>> kernel and now the clock will not move from the time the system was
>> booted, ie:
>> # date
>> Thu Jul 15 16:15:58 PDT 2010
>> <wait a minute>
>> # date
>> Thu Jul 15 16:15:58 PDT 2010
>>
>> I have an old kernel from May 27 which doesn't have this problem. I
>> noticed some clock related stuff changing in current in the last
>> couple of weeks and suspect that their VM setup doesn't play well with
>> these changes (their site says they use Xen, but several boot messages
>> refer to QEMU). Officially, I think they only support running 8.0 so I
>> thought I would ask here if anyone has any ideas before putting in a
>> support request.
>>
>> Here's a diff of the dmesgs - I can post full copies if needed but
>> didn't want to start with a ridicously long message:
>
>>  FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
>>  FreeBSD/SMP: 0 package(s) x 16 core(s) x 2 SMT threads
>>   cpu0 (BSP): APIC ID:  0
>
> Probably not related, but funny. :) So you have two CPUs?

Yes, there's 2 CPUs. It also gives the non uniform processors warning,
but it has been like that forever.

>
>> _at__at_ -81,7 +81,10 _at__at_
>>  ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
>>  ppc0: [ITHREAD]
>>  ppbus0: <Parallel port bus> on ppc0
>> -atrtc0: <AT Real Time Clock> at port 0x70 irq 8 on isa0
>> +atrtc0: <AT realtime clock> at port 0x70 irq 8 on isa0
>> +atrtc0: [FILTER]
>> +Event timer "RTC" frequency 32768 Hz quality 0
>> +Starting kernel event timers: LAPIC _at_ 200Hz, RTC _at_ 128Hz
>>  Timecounters tick every 5.000 msec
>
> Everything seems reasonable there. Try to collect more information:
> sysctl kern.timecounter
> sysctl kern.eventtimer
> vmstat -ia
> systat -vm 1 (presence and frequencies of interrupts)
>
> It could be a bug in emulation of some timers or bug in respective timer
> driver, which was not triggered before last changes. You may try switch
> to different timecounter by setting kern.timecounter.hardware, or
> different eventtimers by setting kern.eventtimer.timer1 and
> kern.eventtimer.timer2 sysctls.
>
> --
> Alexander Motin
>

This is all on the new (not-working) kernel in single user mode:

# sysctl kern.timecounter
kern.timecounter.tick: 1
kern.timecounter.choice: TSC(-100) dummy(-1000000)
kern.timecounter.hardware: dummy
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.TSC.mask: 4294967295
kern.timecounter.tc.TSC.counter: 205772785
kern.timecounter.tc.TSC.frequency: 2261052646
kern.timecounter.tc.TSC.quality: -100
kern.timecounter.smp_tsc: 0
kern.timecounter.invariant_tsc: 1

kern.timecounter.tc.TSC.counter changes everytime (205772785,
3200717147, 1205899870, ...) but I can't see any pattern.

# sysctl kern.eventtimer
kern.eventtimer.choice: LAPIC(500) RTC(0)
kern.eventtimer.et.LAPIC.flags: 15
kern.eventtimer.et.LAPIC.frequency: 50001404
kern.eventtimer.et.LAPIC.quality: 500
kern.eventtimer.et.RTC.flags: 1
kern.eventtimer.et.RTC.frequency: 32768
kern.eventtimer.et.RTC.quality: 0
kern.eventtimer.timer2: RTC
kern.eventtimer.timer1: LAPIC
kern.eventtimer.singlemul: 4
# vmstat -ia
interrupt                          total       rate
???                                    0          0
irq1: atkbd0                         339        339
stray irq1                             0          0
irq0:                                  0          0
stray irq0                             0          0
irq3:                                  0          0
stray irq3                             0          0
irq4: uart0                            0          0
stray irq4                             0          0
irq5: re0                              0          0
stray irq5                             0          0
irq6:                                  0          0
stray irq6                             0          0
irq7: ppc0                             0          0
stray irq7                             0          0
irq8: atrtc0                       24463      24463
stray irq8                             0          0
irq9:                                  0          0
stray irq9                             0          0
irq10: re1                             0          0
stray irq10                            0          0
irq11:                                 0          0
stray irq11                            0          0
irq12: psm0                            0          0
stray irq12                            0          0
irq13:                                 0          0
stray irq13                            0          0
irq14: ata0                          224        224
stray irq14                            0          0
irq15: ata1                            0          0
stray irq15                            0          0
irq16:                                 0          0
stray irq16                            0          0
irq17:                                 0          0
stray irq17                            0          0
irq18:                                 0          0
stray irq18                            0          0
irq19:                                 0          0
stray irq19                            0          0
irq20:                                 0          0
stray irq20                            0          0
irq21:                                 0          0
stray irq21                            0          0
irq22:                                 0          0
stray irq22                            0          0
irq23:                                 0          0
stray irq23                            0          0
irq24:                                 0          0
stray irq24                            0          0
irq25:                                 0          0
stray irq25                            0          0
irq26:                                 0          0
stray irq26                            0          0
irq27:                                 0          0
stray irq27                            0          0
irq28:                                 0          0
stray irq28                            0          0
irq29:                                 0          0
stray irq29                            0          0
irq30:                                 0          0
stray irq30                            0          0
irq31:                                 0          0
stray irq31                            0          0
irq32:                                 0          0
stray irq32                            0          0
irq33:                                 0          0
stray irq33                            0          0
irq34:                                 0          0
stray irq34                            0          0
irq35:                                 0          0
stray irq35                            0          0
irq36:                                 0          0
stray irq36                            0          0
irq37:                                 0          0
stray irq37                            0          0
irq38:                                 0          0
stray irq38                            0          0
irq39:                                 0          0
stray irq39                            0          0
irq40:                                 0          0
stray irq40                            0          0
irq41:                                 0          0
stray irq41                            0          0
irq42:                                 0          0
stray irq42                            0          0
irq43:                                 0          0
stray irq43                            0          0
irq44:                                 0          0
stray irq44                            0          0
irq45:                                 0          0
stray irq45                            0          0
irq46:                                 0          0
stray irq46                            0          0
irq47:                                 0          0
stray irq47                            0          0
cpu0:timer                         38223      38223
cpu1:timer                         38220      38220
Total                             101469     101469

systat -ia cycles between:
526 total
    atkbd0 1
128 atrtc0 8
    ata0 irq14
199 cpu0:timer
199 cpu1:timer

530 total
    atkbd0 1
128 atrtc0 8
    ata0 irq14
201 cpu0:timer
201 cpu1:timer

If I set kern.eventtimer.timer1="RTC", dmesg says:

Starting kernel event timers: RTC _at_ 200Hz, LAPIC _at_ 128Hz
Event timer "LAPIC" is dead.
Starting kernel event timers: RTC _at_ 800Hz, NONE _at_ 0Hz

The clock still doesn't move though.

On the old kernel I had i8254 in the dmesg and that appears to be what was used:
kern.timecounter.tick: 1
kern.timecounter.choice: TSC(-100) i8254(0) dummy(-1000000)
kern.timecounter.hardware: i8254
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.i8254.mask: 65535
kern.timecounter.tc.i8254.counter: 51889
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.TSC.mask: 4294967295
kern.timecounter.tc.TSC.counter: 266155055
kern.timecounter.tc.TSC.frequency: 2261010847
kern.timecounter.tc.TSC.quality: -100
kern.timecounter.smp_tsc: 0
kern.timecounter.invariant_tsc: 1

Also, in the old kernel, there was nothing on irq8 in vmstat:
irq8:                                  0          0
stray irq8                             0          0

At the loader prompt I tried entering set
kern.timecounter.hardware="i8254" and set
kern.timecounter.hardware="TSC" and they appear set correctly if I
type show, but when I boot, the sysctl is back to dummy.

I have zero knowledge of this kind of thing, but I looks to me like I
need to be using i8254 and the new kernel is not detecting this
device. Is there a hint or something I can set to try and pick up this
device again?

Thanks,
-- 
Rob Farmer
Received on Fri Jul 16 2010 - 17:31:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:05 UTC