In http://libvirt.org/formatdomain.html#elementsTime , we could find there are three attributes of catchup tickpolicy: limit, threshold and slew. " The catchup element has three optional attributes, each a positive integer. The attributes are threshold, slew, and limit. " The xml format likes: <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'> <catchup slew='123'/> or <catchup threshold='123'/> or <catchup limit='123'/> </timer> </clock> But there is no further explanation. Does anyone know what's the meaning of these attributes ? Best wishes, Jincheng Miao
On 03/13/2014 12:49 AM, Jincheng Miao wrote:> In http://libvirt.org/formatdomain.html#elementsTime , we could find there are > three attributes of catchup tickpolicy: limit, threshold and slew. > > " > The catchup element has three optional attributes, each a positive integer. > The attributes are threshold, slew, and limit. > " > The xml format likes: > <clock offset='utc'> > <timer name='rtc' tickpolicy='catchup'> > <catchup slew='123'/> or <catchup threshold='123'/> or <catchup limit='123'/> > </timer> > </clock> > > But there is no further explanation. > Does anyone know what's the meaning of these attributes ?We ought to copy the documentation that qemu just added: # Policy for handling lost ticks in timer devices. # # @discard: throw away the missed tick(s) and continue with future injection # normally. Guest time may be delayed, unless the OS has explicit # handling of lost ticks # # @delay: continue to deliver ticks at the normal rate. Guest time will be # delayed due to the late tick # # @merge: merge the missed tick(s) into one tick and inject. Guest time # may be delayed, depending on how the OS reacts to the merging # of ticks # # @slew: deliver ticks at a higher rate to catch up with the missed tick. The # guest time should not be delayed once catchup is complete. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
On Thu, Mar 13, 2014 at 05:26:05AM -0600, Eric Blake wrote:> On 03/13/2014 12:49 AM, Jincheng Miao wrote: > > In http://libvirt.org/formatdomain.html#elementsTime , we could find there are > > three attributes of catchup tickpolicy: limit, threshold and slew. > > > > " > > The catchup element has three optional attributes, each a positive integer. > > The attributes are threshold, slew, and limit. > > " > > The xml format likes: > > <clock offset='utc'> > > <timer name='rtc' tickpolicy='catchup'> > > <catchup slew='123'/> or <catchup threshold='123'/> or <catchup limit='123'/> > > </timer> > > </clock> > > > > But there is no further explanation. > > Does anyone know what's the meaning of these attributes ? > > We ought to copy the documentation that qemu just added: > > # Policy for handling lost ticks in timer devices. > # > # @discard: throw away the missed tick(s) and continue with future injection > # normally. Guest time may be delayed, unless the OS has explicit > # handling of lost ticks > # > # @delay: continue to deliver ticks at the normal rate. Guest time will be > # delayed due to the late tick > # > # @merge: merge the missed tick(s) into one tick and inject. Guest time > # may be delayed, depending on how the OS reacts to the merging > # of ticks > # > # @slew: deliver ticks at a higher rate to catch up with the missed > tick. The > # guest time should not be delayed once catchup is complete.We've got docs about the various policies already, in that link above. What's missing is explanation of thee <catchup> sub-element attributes. These were added in commit 4ee2b31804f4d3477ee83bac28d9991afb0c3393 Author: Laine Stump <laine@laine.org> Date: Wed Mar 31 13:03:54 2010 -0400 Changes to clock timer XML to match final design. The clock timer XML is being updated in the following ways (based on further off-list discussion that was missed during the initial implementation): 1) 'wallclock' is changed to 'track', and the possible values are 'boot' (corresponds to old 'host'), 'guest', and 'wall'. 2) 'mode' has an additional value 'smpsafe' 3) when tickpolicy='catchup', there can be an optional sub-element of timer called 'catchup': <catchup threshold=123 slew=120 limit=10000/> Those three values are all longs, always optional, and if they are present, they are positive. Internally, 0 indicates "unspecified". Even more strangely AFAICT, nothing in any libvirt driver ever uses the threshold/slew/limit values, so I'm wondering why we added them to the XML.... Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
On Thu, Mar 13, 2014 at 02:49:13AM -0400, Jincheng Miao wrote:> In http://libvirt.org/formatdomain.html#elementsTime , we could find there are > three attributes of catchup tickpolicy: limit, threshold and slew. > > " > The catchup element has three optional attributes, each a positive integer. > The attributes are threshold, slew, and limit. > " > The xml format likes: > <clock offset='utc'> > <timer name='rtc' tickpolicy='catchup'> > <catchup slew='123'/> or <catchup threshold='123'/> or <catchup limit='123'/> > </timer> > </clock> > > But there is no further explanation. > Does anyone know what's the meaning of these attributes ? >What an interesting question. At first I thought the meanings are the same as in ntpd(1) and other time-synchonizing apps. But then I looked into the code to see what we're passing to hypervisors and it seems like since 2010, when this was added, these values were never used. [Cc-ing Laine as he is the author of commit 8bf6799b] I can't be sure though. Laine, do you recall any usage of these settings? Martin
On 03/13/2014 07:04 AM, Martin Kletzander wrote:> On Thu, Mar 13, 2014 at 02:49:13AM -0400, Jincheng Miao wrote: >> In http://libvirt.org/formatdomain.html#elementsTime , we could find there are >> three attributes of catchup tickpolicy: limit, threshold and slew. >> >> " >> The catchup element has three optional attributes, each a positive integer. >> The attributes are threshold, slew, and limit. >> " >> The xml format likes: >> <clock offset='utc'> >> <timer name='rtc' tickpolicy='catchup'> >> <catchup slew='123'/> or <catchup threshold='123'/> or <catchup limit='123'/> >> </timer> >> </clock> >> >> But there is no further explanation. >> Does anyone know what's the meaning of these attributes ? >> > What an interesting question. At first I thought the meanings are the > same as in ntpd(1) and other time-synchonizing apps. But then I > looked into the code to see what we're passing to hypervisors and it > seems like since 2010, when this was added, these values were never > used. > > [Cc-ing Laine as he is the author of commit 8bf6799b] > > I can't be sure though. Laine, do you recall any usage of these > settings?They were added after a lengthy discussion between myself, Daniel, and Zach Amsden (who had knowledge of how VMWare deals with clocks) of the requirements for XML to support configuration for all hypervisors' clock models. Basically, all of the XML from the resulting design was implemented, and connected to as many parts of QEMU as were available at the time, with the assumption that as support fleshed out on the backend of QEMU (and those supporting other hypervisors took the time to enhance their drivers), more of the config would be hooked up to actual functionality. At this point it's been nearly 4 years, and as I came into that task as an outsider to clock issues, I have no recollection of details beyond that.