From: Tim Deegan Subject: [PATCH] linux-2.6.18-xen.hg: fix interaction of NTP and dom0->xen time updates Date: Wed, 18 Mar 2009 11:14:10 +0000 Message-ID: <20090318111410.GC11733@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline 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. Signed-off-by: Tim Deegan -- Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.] --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=dom0-ntp diff -r 6669e480cb59 -r 22ba25a7342c arch/i386/kernel/time-xen.c --- a/arch/i386/kernel/time-xen.c Tue Mar 17 14:27:31 2009 +0000 +++ b/arch/i386/kernel/time-xen.c Wed Mar 18 11:09:58 2009 +0000 @@ -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); --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --y0ulUmNC+osPPQO6--