Skip to contentSkip to conversation

ntpd under Xen Dom0 exhibits extremely high jitter/noise? runs stable/quiet under non-xen kernel.

DISCUSSION Pasi Kärkkäinen 4 participants 19 messages Jan 17, 2010 – Jan 19, 2010 10 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Keir and others,

Please check the table in the end of the mail below.. is there hypervisor (boot time) option to make it behave better for ntpd?

-- Pasi

Quoted 202 lines · mail ignored
Quoted 9 lines · Fajar A. Nugraha
Quoted 4 lines

@ novell say it's xen & ntp
@ ntp say it's novell & xen
@ xen say it's novell & ntp

That's why I suggested you use a workaround: use 2.6.18 kernel, either from RHEL or from xen.org :D
If this works -> novell problem
If this doesn't work -> xen problem

Quoted 3 lines · Fajar A. Nugraha

You might want to try latest pv_ops as well
(http://wiki.xensource.com/xenwiki/XenParavirtOps), which should be easier to work with Opensuse since the version number is close.

it seems it's _not_ the kernel -- unless there's a coincident kernel problem across source/vendor ...

per
http://lists.xensource.com/archives/html/xen-devel/2009-12/msg01127.html
http://wiki.xensource.com/xenwiki/XenParavirtOps
http://wiki.xensource.com/xenwiki/Kernel.org_Linux_on_Xen

cd /home/workspace && rm -rf linux-2.6-xen
git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git
linux-2.6-xen
cd linux-2.6-xen
make clean
cp -a .config .config-old
wget -O .config
http://pasik.reaktio.net/xen/pv_ops-dom0-debug/config-2.6.31.4-pvops_dom0-x86_64
make oldconfig
...
Xen PCI Frontend (XEN_PCIDEV_FRONTEND) [N/m/y/?] (NEW) <-- m
...
"IMQ" target support (NETFILTER_XT_TARGET_IMQ) [N/m/?] (NEW) <-- m
...
IMQ (intermediate queueing device) support (IMQ) [M/y/?] (NEW) <-- [enter]
...
Block-device tap backend driver (XEN_BLKDEV_TAP) [N/m/y/?] (NEW) <-- m
...

make bzImage
make modules
make modules_install
strip vmlinux -o vmlinux-stripped
gzip vmlinux-stripped -c > vmlinuz-gzipped

ls -al .config \
        System.map \
        arch/x86/boot/bzImage \
        vmlinux \
        vmlinux-stripped \
        vmlinuz-gzipped

cp -a .config /boot/config-2.6.31.6
cp -a System.map /boot/System.map-2.6.31.6
cp -a arch/x86/boot/bzImage /boot/vmlinuz-2.6.31.6
mkinitrd
ls -al /boot/*2.6.31.6*
-rw-r--r-- 1 root root 98510 2010-01-16 03:02 /boot/config-2.6.31.6
-rw-r--r-- 1 root root 21304611 2010-01-16 04:14 /boot/initrd-2.6.31.6 -rw-r--r-- 1 root root 1940879 2010-01-16 03:14 /boot/System.map-2.6.31.6 -rw-r--r-- 1 root root 3751936 2010-01-16 03:14 /boot/vmlinuz-2.6.31.6

vi /boot/grub/menu.lst
...
title xen.git
root (hd0,0)
kernel /xen.gz loglvl=all loglvl_guest=all dom0_mem=1024M
vga=gfx-1280x1024x32 console=vga,com1 com1=57600,8n1
module /vmlinuz-2.6.31.6 root=/dev/VG0/ROOT rootfstype=ext4
rootflags=journal_checksum resume=/dev/VG0/SWAP nomodeset selinux=0 SELINUX_INIT=NO vga=0x31a console=tty0 console=xvc0,57600
module /initrd-2.6.31.6

title xen.git DISABLED
root (hd0,0)
kernel /vmlinuz-2.6.31.6 root=/dev/VG_SVR/LV_SVR_DOM0_ROOT
rootfstype=ext4 rootflags=journal_checksum resume=/dev/VG_SVR/LV_SVR_DOM0_SWAP nomodeset showopts splash=silent selinux=0 SELINUX_INIT=NO elevator=cfq vga=0x31a console=tty0 console=ttyS0,57600n8
module /initrd-2.6.31.6
...

boot to "xen.git"

uname -a
Linux test 2.6.31.6 #1 SMP Sat Jan 16 03:14:19 PST 2010 x86_64
x86_64 x86_64 GNU/Linux
lsb_release -a
LSB Version:
core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: SUSE LINUX

  Description:    openSUSE 11.2 (x86_64)
  Release:        11.2
  Codename:       n/a

service ntp stop
rm /etc/adjtime /var/
rm /var/lib/ntp/drift/ntp.drift

cat << EOF > /etc/sysconfig/clock
HWCLOCK="--utc"
SYSTOHC="yes"
TIMEZONE="America/Los_Angeles"
DEFAULT_TIMEZONE="US/Pacific"
EOF
hwclock --systohc --utc
service ntp start

sntp clock.isc.org && date && hwclock --utc --show
2010 Jan 16 04:37:09.000729 + 1.435060 +/- 0.028944 secs Sat Jan 16 04:37:11 PST 2010
Sat 16 Jan 2010 04:37:11 AM PST -0.345191 seconds

... (wait ~ 6 hours) ...

date

	Sat Jan 16 11:01:42 PST 2010
ntpq -p -c rv
	assID=0 status=06c4 leap_none, sync_ntp, 12 events, event_peer/strat_chg,
	version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)",
	processor="x86_64", system="Linux/2.6.31.6", leap=00, stratum=2,
	precision=-20, rootdelay=14.718, rootdispersion=135.995, peer=11390,
	refid=66.220.9.122,
	reftime=cefc89b2.a36f1342  Sat, Jan 16 2010 10:53:38.638, poll=6,
	clock=cefc8b82.7e523feb  Sat, Jan 16 2010 11:01:22.493, state=2,
	offset=-115.130, frequency=-500.000, jitter=464.242, noise=29.343,
	stability=154.680
	     remote           refid      st t when poll reach   delay   offset  jitter
	==============================================================================
	*clock.fmt.he.ne .PPS.            1 u   29   64  377   21.438  -811.68 462.837
	+otc2.psu.edu    129.6.15.29      2 u    7   64  377  109.399  -850.99 470.522
	+clock.isc.org   .GPS.            1 u    7   64  377   21.440  -854.82 468.274
	+clock.sjc.he.ne .CDMA.           1 u   49   64  377   16.889  -780.55 469.481
	+zorro.sf-bay.or 216.218.254.202  2 u   59   64  377   20.366  -762.14 458.947
	+nist1.aol-ca.tr .ACTS.           1 u   38   64  377   16.260  -795.87 463.170

boot to "xen.git DISABLED"

uname -a

	Linux test 2.6.31.6 #1 SMP Sat Jan 16 09:14:19 PST 2010 x86_64 x86_64

x86_64 GNU/Linux

service ntp stop
rm /etc/adjtime /var/
rm /var/lib/ntp/drift/ntp.drift
service ntp start

... (wait ~ 10 minutes) ...
date

	Sat Jan 16 11:15:05 PST 2010
ntpq -p -c rv
	assID=0 status=0664 leap_none, sync_ntp, 6 events, event_peer/strat_chg,
	version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)",
	processor="x86_64", system="Linux/2.6.31.6", leap=00, stratum=2,
	precision=-20, rootdelay=22.750, rootdispersion=975.184, peer=43091,
	refid=66.220.9.122,
	reftime=cefc8c7c.35ca466a  Sat, Jan 16 2010 11:05:32.210, poll=6,
	clock=cefc8eb9.25103a1f  Sat, Jan 16 2010 11:15:05.144, state=3,
	offset=27.534, frequency=0.000, jitter=6.740, noise=16.331,
	stability=0.000
	     remote           refid      st t when poll reach   delay   offset  jitter
	==============================================================================
	*clock.fmt.he.ne .PPS.            1 u    4   64  377   18.112   10.541   5.892
	+otc2.psu.edu    147.84.59.145    2 u   64   64  377  101.103   12.106   8.621
	+clock.isc.org   .GPS.            1 u   57   64  377   14.990    4.830   9.622
	+clock.sjc.he.ne .CDMA.           1 u   59   64  377   16.503    9.299   9.440
	+zorro.sf-bay.or 216.218.254.202  2 u   56   64  377   22.212    6.323  11.031
	+nist1.aol-ca.tr .ACTS.           1 u   60   64  377   17.076   14.316   9.260

in summary,

kernel OS/distro xen timekeeping
------------------------------------- --------------- ------- ------------

 opensuse kernel-default-2.6.31.8-0.1  opensuse 11.2   (n/a)   OK
 opensuse kernel-default-2.6.32-41     opensuse 11.2   (n/a)   OK
 opensuse kernel-xen-2.6.31.8-0.1      opensuse 11.2   3.4.x   NOISY/FAIL
 opensuse kernel-xen-2.6.32-41         opensuse 11.2   3.4.x   NOISY/FAIL
 opensuse kernel-xen-2.6.31.8-0.1      opensuse 11.2   4.0.x   NOISY/FAIL
 opensuse kernel-xen-2.6.32-41         opensuse 11.2   4.0.x   NOISY/FAIL
 xen.git  kernel-2.6.31.6 (pvops Dom0) opensuse 11.2   4.0.x   NOISY/FAIL
 xen.git  kernel-2.6.31.6              opensuse 11.2   (n/a)   OK

i.e.,

3 different kernel versions, from two different vendors, have low-noise/accurate timekeeping in NON-xen configs.

boot any of those kernels with either v34x or v40x hypervisor in place, and timekeeping suffers from unusably excessive jitter & offset.

_______________________________________________
Xen-users mailing list
[email protected]
http://lists.xensource.com/xen-users

#11 lore raw

What platform timer does Xen say is initialised during boot? Possibly Xen's 'clocksource=' boot option could be used to select a different platform timer exhibiting less jitter. Tbh I don't think we've ever done a detailed analysis of ntp performance on Xen before -- this is something we might be able to improve.

-- Keir

Quoted 150 lines · Pasi Kärkkäinen

Keir and others,

Please check the table in the end of the mail below.. is there hypervisor (boot time) option to make it behave better for ntpd?

-- Pasi

Quoted 141 lines · mail ignored
Quoted 9 lines · Fajar A. Nugraha
Quoted 4 lines

@ novell say it's xen & ntp
@ ntp say it's novell & xen
@ xen say it's novell & ntp

That's why I suggested you use a workaround: use 2.6.18 kernel, either from RHEL or from xen.org :D
If this works -> novell problem
If this doesn't work -> xen problem

Quoted 3 lines · Fajar A. Nugraha

You might want to try latest pv_ops as well
(http://wiki.xensource.com/xenwiki/XenParavirtOps), which should be easier to work with Opensuse since the version number is close.

it seems it's _not_ the kernel -- unless there's a coincident kernel problem across source/vendor ...

per
http://lists.xensource.com/archives/html/xen-devel/2009-12/msg01127.html
http://wiki.xensource.com/xenwiki/XenParavirtOps
http://wiki.xensource.com/xenwiki/Kernel.org_Linux_on_Xen

cd /home/workspace && rm -rf linux-2.6-xen
git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git
linux-2.6-xen
cd linux-2.6-xen
make clean
cp -a .config .config-old
wget -O .config
http://pasik.reaktio.net/xen/pv_ops-dom0-debug/config-2.6.31.4-pvops_dom0-x86
_64
make oldconfig
...
Xen PCI Frontend (XEN_PCIDEV_FRONTEND) [N/m/y/?] (NEW) <-- m
...
"IMQ" target support (NETFILTER_XT_TARGET_IMQ) [N/m/?] (NEW) <-- m
...
IMQ (intermediate queueing device) support (IMQ) [M/y/?] (NEW) <--
[enter]
...
Block-device tap backend driver (XEN_BLKDEV_TAP) [N/m/y/?] (NEW) <-- m
...

make bzImage
make modules
make modules_install
strip vmlinux -o vmlinux-stripped
gzip vmlinux-stripped -c > vmlinuz-gzipped

ls -al .config \
        System.map \
        arch/x86/boot/bzImage \
        vmlinux \
        vmlinux-stripped \
        vmlinuz-gzipped

cp -a .config /boot/config-2.6.31.6
cp -a System.map /boot/System.map-2.6.31.6
cp -a arch/x86/boot/bzImage /boot/vmlinuz-2.6.31.6
mkinitrd
ls -al /boot/*2.6.31.6*
-rw-r--r-- 1 root root 98510 2010-01-16 03:02 /boot/config-2.6.31.6
-rw-r--r-- 1 root root 21304611 2010-01-16 04:14 /boot/initrd-2.6.31.6 -rw-r--r-- 1 root root 1940879 2010-01-16 03:14 /boot/System.map-2.6.31.6 -rw-r--r-- 1 root root 3751936 2010-01-16 03:14 /boot/vmlinuz-2.6.31.6

vi /boot/grub/menu.lst
...
title xen.git
root (hd0,0)
kernel /xen.gz loglvl=all loglvl_guest=all dom0_mem=1024M
vga=gfx-1280x1024x32 console=vga,com1 com1=57600,8n1
module /vmlinuz-2.6.31.6 root=/dev/VG0/ROOT rootfstype=ext4
rootflags=journal_checksum resume=/dev/VG0/SWAP nomodeset selinux=0 SELINUX_INIT=NO vga=0x31a console=tty0 console=xvc0,57600
module /initrd-2.6.31.6

title xen.git DISABLED
root (hd0,0)
kernel /vmlinuz-2.6.31.6 root=/dev/VG_SVR/LV_SVR_DOM0_ROOT
rootfstype=ext4 rootflags=journal_checksum resume=/dev/VG_SVR/LV_SVR_DOM0_SWAP nomodeset showopts splash=silent selinux=0 SELINUX_INIT=NO elevator=cfq vga=0x31a console=tty0 console=ttyS0,57600n8
module /initrd-2.6.31.6
...

boot to "xen.git"

uname -a
Linux test 2.6.31.6 #1 SMP Sat Jan 16 03:14:19 PST 2010 x86_64
x86_64 x86_64 GNU/Linux
lsb_release -a
LSB Version:
core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_ 64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:gr aphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:g raphics-4.0-noarch
Distributor ID: SUSE LINUX

  Description:    openSUSE 11.2 (x86_64)
  Release:        11.2
  Codename:       n/a

service ntp stop
rm /etc/adjtime /var/
rm /var/lib/ntp/drift/ntp.drift

cat << EOF > /etc/sysconfig/clock
HWCLOCK="--utc"
SYSTOHC="yes"
TIMEZONE="America/Los_Angeles"
DEFAULT_TIMEZONE="US/Pacific"
EOF
hwclock --systohc --utc
service ntp start

sntp clock.isc.org && date && hwclock --utc --show
2010 Jan 16 04:37:09.000729 + 1.435060 +/- 0.028944 secs Sat Jan 16 04:37:11 PST 2010
Sat 16 Jan 2010 04:37:11 AM PST -0.345191 seconds

... (wait ~ 6 hours) ...

date
Sat Jan 16 11:01:42 PST 2010
ntpq -p -c rv
assID=0 status=06c4 leap_none, sync_ntp, 12 events, event_peer/strat_chg, version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)", processor="x86_64", system="Linux/2.6.31.6", leap=00, stratum=2, precision=-20, rootdelay=14.718, rootdispersion=135.995, peer=11390, refid=66.220.9.122,
reftime=cefc89b2.a36f1342 Sat, Jan 16 2010 10:53:38.638, poll=6, clock=cefc8b82.7e523feb Sat, Jan 16 2010 11:01:22.493, state=2, offset=-115.130, frequency=-500.000, jitter=464.242, noise=29.343, stability=154.680
remote refid st t when poll reach delay offset jitter

=============================================================================>> =

Quoted 24 lines
Quoted 24 lines

*clock.fmt.he.ne .PPS. 1 u 29 64 377 21.438 -811.68
462.837
+otc2.psu.edu 129.6.15.29 2 u 7 64 377 109.399 -850.99
470.522
+clock.isc.org .GPS. 1 u 7 64 377 21.440 -854.82
468.274
+clock.sjc.he.ne .CDMA. 1 u 49 64 377 16.889 -780.55
469.481
+zorro.sf-bay.or 216.218.254.202 2 u 59 64 377 20.366 -762.14
458.947
+nist1.aol-ca.tr .ACTS. 1 u 38 64 377 16.260 -795.87
463.170

boot to "xen.git DISABLED"

uname -a
Linux test 2.6.31.6 #1 SMP Sat Jan 16 09:14:19 PST 2010 x86_64 x86_64 x86_64 GNU/Linux

service ntp stop
rm /etc/adjtime /var/
rm /var/lib/ntp/drift/ntp.drift
service ntp start

Quoted 15 lines
Quoted 6 lines

... (wait ~ 10 minutes) ...
date
Sat Jan 16 11:15:05 PST 2010
ntpq -p -c rv
assID=0 status=0664 leap_none, sync_ntp, 6 events, event_peer/strat_chg, version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)",

Quoted 9 lines

processor="x86_64", system="Linux/2.6.31.6", leap=00, stratum=2, precision=-20, rootdelay=22.750, rootdispersion=975.184, peer=43091, refid=66.220.9.122,
reftime=cefc8c7c.35ca466a Sat, Jan 16 2010 11:05:32.210, poll=6, clock=cefc8eb9.25103a1f Sat, Jan 16 2010 11:15:05.144, state=3, offset=27.534, frequency=0.000, jitter=6.740, noise=16.331, stability=0.000
remote refid st t when poll reach delay offset jitter

=============================================================================>> =

Quoted 39 lines
Quoted 39 lines

*clock.fmt.he.ne .PPS. 1 u 4 64 377 18.112 10.541
5.892
+otc2.psu.edu 147.84.59.145 2 u 64 64 377 101.103 12.106
8.621
+clock.isc.org .GPS. 1 u 57 64 377 14.990 4.830
9.622
+clock.sjc.he.ne .CDMA. 1 u 59 64 377 16.503 9.299
9.440
+zorro.sf-bay.or 216.218.254.202 2 u 56 64 377 22.212 6.323
11.031
+nist1.aol-ca.tr .ACTS. 1 u 60 64 377 17.076 14.316
9.260

in summary,

kernel OS/distro xen timekeeping
------------------------------------- --------------- ------- ------------

 opensuse kernel-default-2.6.31.8-0.1  opensuse 11.2   (n/a)   OK
 opensuse kernel-default-2.6.32-41     opensuse 11.2   (n/a)   OK
 opensuse kernel-xen-2.6.31.8-0.1      opensuse 11.2   3.4.x   NOISY/FAIL
 opensuse kernel-xen-2.6.32-41         opensuse 11.2   3.4.x   NOISY/FAIL
 opensuse kernel-xen-2.6.31.8-0.1      opensuse 11.2   4.0.x   NOISY/FAIL
 opensuse kernel-xen-2.6.32-41         opensuse 11.2   4.0.x   NOISY/FAIL
 xen.git  kernel-2.6.31.6 (pvops Dom0) opensuse 11.2   4.0.x   NOISY/FAIL
 xen.git  kernel-2.6.31.6              opensuse 11.2   (n/a)   OK

i.e.,

3 different kernel versions, from two different vendors, have low-noise/accurate timekeeping in NON-xen configs.

boot any of those kernels with either v34x or v40x hypervisor in place, and timekeeping suffers from unusably excessive jitter & offset.

_______________________________________________
Xen-users mailing list
[email protected]
http://lists.xensource.com/xen-users

#12 lore raw

hi,

(should I keep replying to both lists now?)

Quoted 1 line · Keir Fraser

What platform timer does Xen say is initialised during boot?

xm dmesg | egrep -i "timer|clock"
(XEN) ACPI: PM-Timer IO Port: 0x808
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1 (XEN) Platform timer is 14.284MHz HPET
(XEN) HPET: 4 timers in total, 3 timers will be used for broadcast (XEN) mcheck_poll: Machine check polling timer started.

Quoted 3 lines

Possibly Xen's
'clocksource=' boot option could be used to select a different platform timer exhibiting less jitter.

currently, i have " ... clocksource=xen ... "

on these platforms,

@ non-xen,

uname -a
Linux test 2.6.31.8-0.1-desktop #1 SMP PREEMPT 2009-12-15 23:55:40
+0100 x86_64 x86_64 x86_64 GNU/Linux
cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm
cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc

i've read "tsc" is a "good thing ..." ...

but, @ xen, i've only,

uname -a
Linux test 2.6.31.8-0.1-xen #1 SMP 2009-12-15 23:55:40 +0100 x86_64
x86_64 x86_64 GNU/Linux
cat /sys/devices/system/clocksource/clocksource0/available_clocksource
xen jiffies
cat /sys/devices/system/clocksource/clocksource0/current_clocksource
xen

i've already tried the apparently only other option, 'jiffies', as a xen clocksource,

echo "jiffies" >
/sys/devices/system/clocksource/clocksource0/current_clocksource
cat /sys/devices/system/clocksource/clocksource0/current_clocksource
jiffies
service ntp restart
(also tried this experiemtn booting to clocksource=jiffies in grub conf -- no difference)

but i've noticed no improvement in jitter/offset over time,

assID=0 status=c654 sync_alarm, sync_ntp, 5 events, event_peer/strat_chg, version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)", processor="x86_64", system="Linux/2.6.31.8-0.1-xen", leap=11, stratum=2, precision=-8, rootdelay=0.000, rootdispersion=10.755, peer=34524, refid=Qq,
reftime=00000000.00000000 Wed, Feb 6 2036 22:28:16.000, poll=6, clock=cefe0ad1.036efb16 Sun, Jan 17 2010 14:18:49.013, state=2, offset=0.000, frequency=-362.896, jitter=568.398, noise=3.906, stability=0.000
remote refid st t when poll reach delay offset jitter
==============================================================================

+clock.fmt.he.ne .PPS.            1 u   26   64  377   18.351  -1363.2 572.904
+otc2.psu.edu    128.118.2.33     2 u   58   64  377   99.412  -1298.6 575.668
+clock.isc.org   .GPS.            1 u   61   64  377   19.111  -1296.8 562.546
+clock.sjc.he.ne .CDMA.           1 u   35   64  377   24.181  -1341.8 561.600
+zorro.sf-bay.or 216.218.254.202  2 u   63   64  377   20.503  -1290.7 565.956
*nist1.aol-ca.tr .ACTS.           1 u   35   64  377   24.571  -1339.8 567.403

and, in both these results, & at initially startup,

assID=0 status=c035 sync_alarm, sync_unspec, 3 events, event_clock_reset, version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)", processor="x86_64", system="Linux/2.6.31.8-0.1-xen", leap=11, stratum=16, precision=-8, rootdelay=0.000, rootdispersion=0.930, peer=0, refid=STEP, reftime=00000000.00000000 Wed, Feb 6 2036 22:28:16.000, poll=4, clock=cefe0842.32f14db2 Sun, Jan 17 2010 13:26:54.198, state=4, offset=0.000, frequency=-362.896, jitter=5.498, noise=3.906, stability=0.000
remote refid st t when poll reach delay offset jitter
==============================================================================

 clock.fmt.he.ne .PPS.            1 u   17   64    1   20.834  -88.894   3.906
 otc2.psu.edu    130.207.244.240  2 u   54   64    1  123.655  -12.796   3.906
 clock.isc.org   .GPS.            1 u   49   64    1   19.517  -34.400   3.906
 clock.sjc.he.ne .CDMA.           1 u   25   64    1   16.966  -76.911   3.906
 zorro.sf-bay.or 216.218.254.202  2 u   48   64    1   35.391  -29.823   3.906
 nist1.aol-ca.tr .ACTS.           1 u   24   64    1   24.211  -74.151   3.906

-- i see "3.906 weirdness". notice the 3.906's in the jitter
(changes over time) & noise/offset (fixed over time) fields?

looking around on the net, i've found no particular explanation for this; tbh, it doesn't exactly breed confidence.

Quoted 2 lines

Tbh I don't think we've ever done a detailed analysis of ntp performance on Xen before -- this is something we might be able to improve.

any help would be appreciated.

thanks.

#13 lore raw
Quoted 5 lines · mail ignored
Quoted 3 lines

Possibly Xen's
'clocksource=' boot option could be used to select a different platform timer exhibiting less jitter.

currently, i have " ... clocksource=xen ... "

I meant clocksource= on Xen's command line, not dom0's. I don't think it even has an effect when specified to a kernel running on Xen.

For example, you could try clocksource=acpi, or clocksource=pit. And then check that the 'Platform timer is...' line from Xen boot output changes correspondingly.

-- Keir

#14 lore raw

hi

Quoted 2 lines · Keir Fraser

I meant clocksource= on Xen's command line, not dom0's. I don't think it even has an effect when specified to a kernel running on Xen.

where is that documented? tbh, i've never noticed those options at all. checking here,

http://wiki.xensource.com/xenwiki/?action=fullsearch&context=180&value=clocksource&fullsearch=Text

those references only mention clocksource= @kernel line, and the xen user's manual doesn't mention the term clocksource at all :-/

there's no mention

Quoted 3 lines

For example, you could try clocksource=acpi, or clocksource=pit. And then check that the 'Platform timer is...' line from Xen boot output changes correspondingly.

checking those now ... will report results in a bot.

thanks.

#15 lore raw
Quoted 5 lines · mail ignored
Quoted 3 lines

For example, you could try clocksource=acpi, or clocksource=pit. And then check that the 'Platform timer is...' line from Xen boot output changes correspondingly.

checking those now ... will report results in a bit.

both seem to work ...

booting to,

/xen.gz ... clocksource=acpi ...

then,

xm dmesg | grep -i timer
(XEN) ACPI: PM-Timer IO Port: 0x808
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1 (XEN) Platform timer is 3.579MHz ACPI PM Timer
(XEN) HPET: 4 timers in total, 3 timers will be used for broadcast (XEN) mcheck_poll: Machine check polling timer started.

~ 15 minutes, quiet/stable operation @ stratum=2, full reach.

	assID=0 status=0684 leap_none, sync_ntp, 8 events, event_peer/strat_chg,
	version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)",
	processor="x86_64", system="Linux/2.6.31.8-0.1-xen", leap=00, stratum=2,
	precision=-20, rootdelay=13.970, rootdispersion=26.079, peer=33500,
	refid=216.218.254.202,
	reftime=ceff1d2c.ddbe13c0  Mon, Jan 18 2010  9:47:24.866, poll=6,
	clock=ceff1e07.464f2053  Mon, Jan 18 2010  9:51:03.274, state=4,
	offset=15.245, frequency=24.962, jitter=10.571, noise=17.706,
	stability=7.306
	     remote           refid      st t when poll reach   delay   offset  jitter
	==============================================================================
	-clock.fmt.he.ne .PPS.            1 u   41   64  377   16.047   20.346  10.336
	-otc2.psu.edu    130.207.244.240  2 u   39   64  377  100.626   14.538   5.387
	+clock.isc.org   .GPS.            1 u   54   64  377   15.174   -0.843  10.578
	*clock.sjc.he.ne .CDMA.           1 u   26   64  377   13.970   12.255   7.051
	 zorro.sf-bay.or 216.218.254.202  2 u   31   64  377   16.489   13.730   5.781
	+nist1.aol-ca.tr .ACTS.           1 u   15   64  377   14.891    5.947  14.596

booting to,

/xen.gz ... clocksource=pit ...

xm dmesg | grep -i timer
(XEN) ACPI: PM-Timer IO Port: 0x808
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1 (XEN) Platform timer is 1.193MHz PIT
(XEN) mcheck_poll: Machine check polling timer started.

~ 20 minutes, quiet/stable operation @ stratum=2, full reach.

	assID=0 status=0654 leap_none, sync_ntp, 5 events, event_peer/strat_chg,
	version="ntpd [email protected] Mon Dec 28 17:26:30 UTC 2009 (1)",
	processor="x86_64", system="Linux/2.6.31.8-0.1-xen", leap=00, stratum=2,
	precision=-20, rootdelay=16.981, rootdispersion=31.958, peer=63536,
	refid=207.200.81.113,
	reftime=ceff2377.503b4ceb  Mon, Jan 18 2010 10:14:15.313, poll=6,
	clock=ceff240e.fa89c747  Mon, Jan 18 2010 10:16:46.978, state=4,
	offset=9.641, frequency=4.070, jitter=12.958, noise=6.244,
	stability=0.834
	     remote           refid      st t when poll reach   delay   offset  jitter
	==============================================================================
	+clock.fmt.he.ne .PPS.            1 u   30   64  177   15.250    8.422   9.657
	+otc2.psu.edu    147.84.59.145    2 u   33   64  177   99.375   10.359   8.906
	+clock.isc.org   .GPS.            1 u   25   64  177   13.060    2.679   9.501
	+clock.sjc.he.ne .CDMA.           1 u   22   64  177   15.097   10.608   7.866
	+zorro.sf-bay.or 216.218.254.202  2 u   27   64  177   15.082    9.639   8.443
	*nist1.aol-ca.tr .ACTS.           1 u   23   64  177   16.981   15.780   7.743

seemingly, _nothing_ to do with the kernel, then. rather overriding whatever xen's default clocksource is does the trick.

i'll still take a look over longer term @ Dom0, and see if there's any strangeness in DomU time ...

thanks!

#16 lore raw

wrt acpi vs pit,

reading @ http://the-b.org/Linux_timers, it seems (?) acpi may be, in general, the better options, as pit " ... doesn't gain lost time because it doesn't have lost tick correction code ..."

iiuc, that references those timers @kernel -- not clear if it is/isn't relevant to Xen ...

#17 lore raw
Quoted 9 lines · mail ignored

wrt acpi vs pit,

reading @ http://the-b.org/Linux_timers, it seems (?) acpi may be, in general, the better options, as pit " ... doesn't gain lost time because it doesn't have lost tick correction code ..."

iiuc, that references those timers @kernel -- not clear if it is/isn't relevant to Xen ...

What was the default clocksource for you, showing the bad ntpd behaviour?

-- Pasi

#18 lore raw
Quoted 2 lines · Pasi Kärkkäinen

What was the default clocksource for you, showing the bad ntpd behaviour?

from above,

Quoted 1 line

On Sun, Jan 17, 2010 at 1:33 PM, Keir Fraser

Quoted 8 lines · <[email protected]> wrote:
Quoted 1 line

What platform timer does Xen say is initialised during boot?

xm dmesg | egrep -i "timer|clock"
(XEN) ACPI: PM-Timer IO Port: 0x808
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1 (XEN) Platform timer is 14.284MHz HPET
(XEN) HPET: 4 timers in total, 3 timers will be used for broadcast (XEN) mcheck_poll: Machine check polling timer started.

, looks like HPET,

#19 lore raw

this page,

http://wiki.xensource.com/xenwiki/xenpm

seems to address hpet, pit & acpi timer sources. and does so without every mentioning 'clocksource' ...
tbh, i can't get past the broken english on the page; it would be really helpful if someone who actually understands that stuff cleaned up the readability.

the recommendations there are( i think?) "by far" to use HPET/PIT. which contraindicates the conclusion that I came to above :-/

so, questions are:

(1) *is* there, in fact, a bug here?
(2) which Timer is, in keeping with any/all issues discussed @ the aforementioned wiki page, recommended?
(3) is the *real* answer simply intended to be "try them all, pick what works"?

#20 lore raw
Quoted 10 lines · mail ignored

this page,

http://wiki.xensource.com/xenwiki/xenpm

seems to address hpet, pit & acpi timer sources. and does so without every mentioning 'clocksource' ...
tbh, i can't get past the broken english on the page; it would be really helpful if someone who actually understands that stuff cleaned up the readability.

I added a couple of "clocksource" words and added one chapter to the end of the page.

-- Pasi

#21 lore raw
In reply to mail ignored
Quoted 1 line · mail ignored

(1) *is* there, in fact, a bug here?

It's not clear. It could alternatively be a problem with the HPET on that specific system. Have you reproduced your issues on a different type of system (making sure that HPET platform timer is detected and used on that system too, of course)? That would then obviously point more at it being a software bug. What is the make/model of the system exhibiting the problem, by the way?

Quoted 2 lines

(2) which Timer is, in keeping with any/all issues discussed @ the aforementioned wiki page, recommended?

HPET or ACPI-PM timers ought to work equally well, assuming bugs haven't crept into Xen's code paths for either one, and both are implemented correctly by the hardware Xen is running on. I have to say I think it's unlikely to be a software bug, because Xen's code paths to use HPET and ACPI-PM timers are really very simple indeed -- it's hard to see where a bug could exist in there. But of course that doesn't make it absolutely impossible.

Quoted 2 lines

(3) is the *real* answer simply intended to be "try them all, pick what works"?

Well, really there oughtn't to be enough of a difference between them for anyone to really notice or care which is actually being used. If this does turn out to be a hardware issue, then yes that is just the kind of case where you might expect to have to tweak things on the Xen command line.

One option for us is to change the priority ordering of platform timers to prefer ACPI-PM above HPET, when both are available. That would assume that ACPI-PM is more reliable than HPET across a wide range of systems though. We don't really have much evidence one way or the other.

Another would be to dynamically detect platform timers that aren't working well and disable them at run time. That would require some more thought, and isn't going to be something for Xen 4.0 at this point.

-- Keir

#22 lore raw

hi

Quoted 10 lines · Keir Fraser
Quoted 1 line · mail ignored

(1) *is* there, in fact, a bug here?

It's not clear. It could alternatively be a problem with the HPET on that specific system. Have you reproduced your issues on a different type of system (making sure that HPET platform timer is detected and used on that system too, of course)? That would then obviously point more at it being a software bug. What is the make/model of the system exhibiting the problem, by the way?

the 5 boxes on which this is currently tested/reproducible are

mobo + cpu:
(1)(2) ASUS M4A78T-E AM3 AMD 790GX ATX, 2 @ AMD Phenom II X4 945 cpu
(3) MSI 790FX-GD70 AM3 AMD 790FX ATX, 1 @ AMD Phenom II X4 920 cpu
(4)(5) GIGABYTE GA-MA770T-UD3P AM3 AMD 770 ATX, 1 @ AMD Phenom II X4 945 cpu
1 @ AMD Phenom II X4 920 cpu

all opensuse 11.2 ...

Quoted 10 lines
Quoted 2 lines

(2) which Timer is, in keeping with any/all issues discussed @ the aforementioned wiki page, recommended?

HPET or ACPI-PM timers ought to work equally well, assuming bugs haven't crept into Xen's code paths for either one, and both are implemented correctly by the hardware Xen is running on. I have to say I think it's unlikely to be a software bug, because Xen's code paths to use HPET and ACPI-PM timers are really very simple indeed -- it's hard to see where a bug could exist in there. But of course that doesn't make it absolutely impossible.

from reading the wiki page, i got the sense that HPET is "by far" recommended -- if only due to lack of specific mention of acpi(_pm) as clocksource.

can't argue with the fact that it works, though. if "ACPI-PM timers ought to work equally well", then I've a clear option/solution -- and knowledge enuf, now, to know where to look for related problems should they creep up in the future, perhaps on new/different hardware.

Quoted 5 lines
Quoted 2 lines

(3) is the *real* answer simply intended to be "try them all, pick what works"?

Well, really there oughtn't to be enough of a difference between them for anyone to really notice or care which is actually being used.

ok. though, reproducibly across all the aforementioned systems, there is.

Quoted 3 lines

If this does
turn out to be a hardware issue, then yes that is just the kind of case where you might expect to have to tweak things on the Xen command line.

the 'common' hardware is, of course, the AMD Phenom II X4 cpu ...

Quoted 4 lines

One option for us is to change the priority ordering of platform timers to prefer ACPI-PM above HPET, when both are available. That would assume that ACPI-PM is more reliable than HPET across a wide range of systems though. We don't really have much evidence one way or the other.

that really only makes sense, doesn't it, if it's known to be NOT
problematic on other platforms. given my obviously limited expertise
in the xen source, this all 'smells' like a problem ...

Quoted 3 lines

Another would be to dynamically detect platform timers that aren't working well and disable them at run time. That would require some more thought, and isn't going to be something for Xen 4.0 at this point.

understood.

pls let me know if there's additional info you need; or, if this should issue should simply be allowed to 'fade' now that there's a clear WORKSFORSOME solution.

thanks.

#23 lore raw
Quoted 5 lines · mail ignored
Quoted 3 lines

If this does
turn out to be a hardware issue, then yes that is just the kind of case where you might expect to have to tweak things on the Xen command line.

the 'common' hardware is, of course, the AMD Phenom II X4 cpu ...

The particular hardware that really matters is the chipset, as that is where the HPET resides. Is that common across all the systems?

-- Keir

#24 lore raw
Quoted 11 lines · Keir Fraser
Quoted 5 lines · mail ignored
Quoted 3 lines

If this does
turn out to be a hardware issue, then yes that is just the kind of case where you might expect to have to tweak things on the Xen command line.

the 'common' hardware is, of course, the AMD Phenom II X4 cpu ...

The particular hardware that really matters is the chipset, as that is where the HPET resides. Is that common across all the systems?

no, not identical,

(1)(2) ASUS M4A78T-E
North Bridge AMD 790GX
South Bridge AMD SB750

(3) MSI 790FX-GD70
North Bridge AMD 790FX
South Bridge AMD SB750

(4)(5) GIGABYTE GA-MA770T-UD3P
North Bridge AMD 770
South Bridge AMD SB710

but, perhaps, related enough?

#25 lore raw
In reply to Keir Fraser
Quoted 8 lines · Keir Fraser
Quoted 5 lines
Quoted 3 lines

If this does
turn out to be a hardware issue, then yes that is just the kind of case where you might expect to have to tweak things on the Xen command line.

the 'common' hardware is, of course, the AMD Phenom II X4 cpu ...

The particular hardware that really matters is the chipset, as that is where the HPET resides. Is that common across all the systems?

Oh, I see they do vary, although all are AMD chipsets of presumably a similar vintage.

-- Keir

#26 lore raw
In reply to Keir Fraser
Quoted 3 lines · Keir Fraser

Tbh I don't think we've ever done a detailed
analysis of ntp performance on Xen before -- this is something we might be able to improve.

just fyi -- this may be all old info for you -- this

"Kernel Model for Precision Timekeeping"
http://www.eecis.udel.edu/~mills/ntp/html/kern.html

and the site/info around it, seem to be the authoritative resource on timekeeping with ntp (function, debugging, etc).

it's been a great resource in understanding the expected behavior of ntp.

i also found good general guidance in

"Network Time Protocol (NTP) Overview and Configuration: An Internet2 Cookbook"
http://e2epi.internet2.edu/npw/binder-docs/ntp-cookbook.pdf

although it does include a # of quotes/references to Mills' bias against Linux, e.g.,

“I have confronted Linux many, many times with broken this and that
and concluded I will not attempt to examine, fix, or judge anything Linux. You are on your own.” —David L. Mills, 2004-10-20

so it's not clear, at least to me, if there are in fact 'deeper' issues with ntp at hand. hopefully that's gotten better over the years ...

hth.

#27 lore raw

I'm away from the office right now so can't easily look this up but the following patch was submitted by Tim Deegan in March 2009 and may be relevant. Likely it is in Xen's dom0 but not in the dom0 of the distro you are using.

Apologies if I've missed an important point as I'm only skimming email today and just happened to have Tim's March email in a folder.

Re: [Xen-devel] [PATCH] linux-2.6.18-xen.hg: fix interaction of NTP and dom0->xen time updates

Quoted 51 lines

-----Original Message-----
From: mail ignored [mailto:[email protected]]
Sent: Sunday, January 17, 2010 4:53 PM
To: Keir Fraser
Cc: Fajar A. Nugraha; [email protected]; Xen User-List
Subject: [Xen-devel] Re: [Xen-users] ntpd under Xen Dom0 exhibits extremely high jitter/noise? runs stable/quiet under non-xen kernel.

Quoted 2 lines · Keir Fraser

Tbh I don't think we've ever done a detailed analysis of ntp performance on Xen before -- this is

something we might be

Quoted 1 line

able to improve.

just fyi -- this may be all old info for you -- this

"Kernel Model for Precision Timekeeping"
http://www.eecis.udel.edu/~mills/ntp/html/kern.html

and the site/info around it, seem to be the authoritative resource on timekeeping with ntp (function, debugging, etc).

it's been a great resource in understanding the expected behavior of ntp.

i also found good general guidance in

"Network Time Protocol (NTP) Overview and Configuration: An
Internet2 Cookbook"
http://e2epi.internet2.edu/npw/binder-docs/ntp-cookbook.pdf

although it does include a # of quotes/references to Mills' bias against Linux, e.g.,

“I have confronted Linux many, many times with broken this and that
and concluded I will not attempt to examine, fix, or judge anything Linux. You are on your own.” —David L. Mills, 2004-10-20

so it's not clear, at least to me, if there are in fact 'deeper' issues with ntp at hand. hopefully that's gotten better over the years ...

hth.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#28 lore raw
Quoted 8 lines · Dan Magenheimer

I'm away from the office right now so can't easily look this up but the following patch was submitted by Tim Deegan in March 2009 and may be relevant.  Likely it is in Xen's dom0 but not in the dom0 of the distro you are using.

Apologies if I've missed an important point as I'm only skimming email today and just happened to have Tim's March email in a folder.

reading @ the patch thread, http://tinyurl.com/yjnj6wa

for reference ... checking in opensuse's src trees,

cd /usr/src
find . | grep x86 | grep time | grep xen | grep "\.c"$ ./arch/x86/kernel/time_32-xen.c ./arch/x86/xen/time.c

time_32-xen.c is posted -> http://pastebin.com/f72c6de07
time.c -> http://pastebin.com/f3b4a7fdd

checking in xen.git's pvops tree,
find . | grep x86 | grep time | grep xen | grep "\.c"$
./arch/x86/xen/time.c

-> http://pastebin.com/f3409ea7a.