I've set up an Unraid VM according to this documentation:
https://wiki.unraid.net/Manual/VM_Guest_Support#Unraid
During this process the "Slackware" template is being used. The default settings for the <clock> element in this template is this:
<clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> </clock>
Immediately after boot of this VM I checked the available clocksources:
root@TowerVM01:~# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
acpi_pm
I couldn't believe that because "acpi_pm" is not mentioned anywhere. Looking in the syslog I do see "tsc" problems. This is usual for "tsc" running in a VM, but it's not usual here because "tsc" is not mentioned in the <clock> element at all. So I did another test:
<clock offset='utc'> <timer name='tsc' tickpolicy='catchup' mode='auto'/> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> </clock>
After that "tsc" is not mentioned in the "available_clocksource" again. Seems that this line was ignored.
After playing around with the <clock> section I came to the conclusion, that the <clock> element is not taken into account at all.
Here's what the same Unraid installation looks like, if running bare bone on host:
root@Tower:~# cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc hpet acpi_pm
The "hpet" clock is set to "present='no'" in the VM declaration so I do understand it's absence. But what about "tsc". Whatever I do, it's not mentioned - but temporarely used during boot:
root@TowerVM01:~# grep -i clocks /var/log/syslog May 18 06:54:02 TowerVM01 kernel: clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns May 18 06:54:02 TowerVM01 kernel: clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x285cbb610e9, max_idle_ns: 440795254255 ns May 18 06:54:02 TowerVM01 kernel: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns May 18 06:54:02 TowerVM01 kernel: clocksource: timekeeping watchdog on CPU1: Marking clocksource 'tsc-early' as unstable because the skew is too large: May 18 06:54:02 TowerVM01 kernel: clocksource: 'refined-jiffies' wd_now: fffb7010 wd_last: fffb6e18 mask: ffffffff May 18 06:54:02 TowerVM01 kernel: clocksource: 'tsc-early' cs_now: 21906dee90 cs_last: 20e092a210 mask: ffffffffffffffff May 18 06:54:02 TowerVM01 kernel: tsc: Marking TSC unstable due to clocksource watchdog May 18 06:54:02 TowerVM01 kernel: clocksource: Switched to clocksource refined-jiffies May 18 06:54:02 TowerVM01 kernel: clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns May 18 06:54:02 TowerVM01 kernel: clocksource: Switched to clocksource acpi_pm
The reason why I play around with the <clock> element is, that in the same second of the VM boot, "tsc" is marked unstable and Unraid switches to "acpi_pm". This results in a 75% performance reduction. A parity check goes down from 15 hours (on tsc) to 60 hours (on acpi_pm). I do know these values because it was working 1-2 years ago.
So: What's the problem with the clocks and the <clock> section in a VM. Is this ignored?
Recommended Comments
There are no comments to display.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.