linux-2.6.18-xen.hg: fix interaction of NTP and dom0->xen time updates
PATCH 1/1 linux-2.6.18-xen.hg: fix interaction of NTP and dom0->xen time updates
Don't discard NTP sync when updating Xen wallclock time from dom0, as that's almost the first thing we do when we become synced. Move the call to ntp_clear() into do_settimeofday(), which is the only caller of __update_wallclock() that looks like it should break NTP sync.
This fixes the timer chain that sets Xen's wallclock every minute when dom0 is NTP synced, which in turn greatly improves wallclock accuracy in PV domU.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]
arch/i386/kernel/time-xen.c +1 -2
@@ -286,8 +286,6 @@set_normalized_timespec (&xtime, xtime_sec, xtime_nsec);set_normalized_timespec (&wall_to_monotonic, wtm_sec, wtm_nsec); - -ntp_clear (); }static void update_wallclock (void )
@@ -496,6 +494,7 @@__normalize_time (&sec, &nsec);__update_wallclock (sec, nsec); } +ntp_clear ();/* Reset monotonic gettimeofday() timeval. */ spin_lock (&monotonic_lock);
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Hi Tim --
Cool!
Just checking... this provides improvement when:
1) the patch is applied to dom0
2) dom0 is running NTP
3) pv domU has independent_wallclock=0
4) pv domU is NOT running NTP
Correct? Does it also help when:
1) the patch is applied to pv domU
2) pv domU has independent_wallclock=1
3) pv domU IS running NTP
Are there any other configurations where it will help? Are there any configurations where it might cause problems?
Thanks,
Dan
Quoted 27 lines
-----Original Message-----
From: Tim Deegan [mailto:[email protected]]
Sent: Wednesday, March 18, 2009 5:14 AM
To: [email protected]
Subject: [Xen-devel] [PATCH] linux-2.6.18-xen.hg: fix interaction of NTP
anddom0->xentime updatesDon't discard NTP sync when updating Xen wallclock time from dom0, as that's almost the first thing we do when we become synced. Move the call to
ntp_clear()intodo_settimeofday(), which is the only caller of__update_wallclock()that looks like it should break NTP sync.This fixes the timer chain that sets Xen's wallclock every minute when dom0 is NTP synced, which in turn greatly improves wallclock accuracy in
PV domU.Signed-off-by Tim Deegan <[email protected]>Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]
Quoted 6 lines · Dan Magenheimer
Just checking... this provides improvement when:
1) the patch is applied to dom0
2) dom0 is running NTP
3) pv domU has independent_wallclock=0
4) pv domU is NOT running NTP
Yes, exactly that. Xen's wallclock tends to sawtooth, drifting with the underlying stime and being pulled back whenever dom0 updates it. Without this patch, it pulls back only when ntpd in dom0 calls adjtime (allowing for up to 100ms of drift on my test machine). With the patch it updates every minute, as intended (still sawtoothing but not as wildly).
Quoted 5 lines
Correct? Does it also help when:
1) the patch is applied to pv domU
2) pv domU has independent_wallclock=1
3) pv domU IS running NTP
Not sure, but I would guess not -- with independent_wallclock==1, domU shuold be ignoring the wc_sec and wc_nsec values provided by Xen, which are the only things affected by this patch.
Quoted 3 lines
Are there any other configurations where it will help? Are there any configurations where it might cause problems?
I don't think so, to either question. If there's some bad condition that is triggered by the act of pulling time back in sync rather than the size of the correction, it might be more frequent with the more frequent updates. Otherwise, it's just making an existing sawtooth a bit less blatant.
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]