From: Randy Thelen Subject: Xen time update algorithms Date: Wed, 15 Nov 2006 12:26:22 -0800 Message-ID: <2C1100D3-C595-461E-BA1B-62BEE3D661BB@netapp.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit Return-path: 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 List-Id: xen-devel@lists.xenproject.org Folks -- My colleague and I are looking at the linux update_wallclock() algorithm and the same (more or less) algorithm in FreeBSD. And we've noticed an independent_wallclock variable and associated functions in Linux that look like they provide some utility. In Linux: static void update_wallclock(void) { shared_info_t *s = HYPERVISOR_shared_info; do { shadow_tv_version = s->wc_version; rmb(); shadow_tv.tv_sec = s->wc_sec; shadow_tv.tv_nsec = s->wc_nsec; rmb(); } while ((s->wc_version & 1) | (shadow_tv_version ^ s- >wc_version)); if (!independent_wallclock) __update_wallclock(shadow_tv.tv_sec, shadow_tv.tv_nsec); } In FreeBSD there isn't the check for independent_wallclock, nor any __update_wallclock()-like functionality. However, it appears that the __update_wallclock() algorithm is necessary. My questions are: 1) Is support for independent_wallclock functionality "relatively" new? (i.e., Last couple of years? Or, since Xen 2.0?) 2) Is (!independent_wallclock) ever true? If so, what sort of environments? Is it true for dom0? Is there a guest mode where having an independent wallclock is appropriate? 3) Is most everything in the linux-xen-sparse tree under the LGPL license? We're working to port the code from linux-xen-sparse/time-xen.c to FreeBSD in order to fix our problem; we're just curious about the environment in which the code runs. -- Randy