WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] timer_mode default change?!?

To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Subject: Re: [Xen-devel] timer_mode default change?!?
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Fri, 10 Oct 2008 00:57:57 +0100
Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Thu, 09 Oct 2008 16:58:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <37cd8e50-d7df-4d13-8572-a52b3f7b7e54@default>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20080930220706.GB1748@xxxxxxxxxxxxxxxxxxxxxxx> <37cd8e50-d7df-4d13-8572-a52b3f7b7e54@default>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Thu, Oct 09, 2008 at 10:50:05PM +0000, Dan Magenheimer wrote:

> > > Huh?
> > > guest prefers timer_mode==1.
> > 
> > Solaris does :)
> 
> Perhaps you can explain what timer_mode==1 does then?
> how it differs from timer_mode==0 and timer_mode==2)
> never quite understood it and an attempt to document timer_mode
> that I posted several months ago left timer_mode==1 rather
> vague.

Here's a copy of an explanation found etched on a mysterious rock in the
Sinai desert (that is, I was forwarded it):

"""
Timer_mode 0/1 track exact number of timer interrupt which need be
injected to guest. If timer interrupts cannot be injected on time,
pending_count++. The difference is that for mode 0, guest TSC is also
hold back if there are timer interrupts pending, while for mode 1 guest
TSC always equals to (host TSC - constant offset)

Time mode 2/3 don't inject each pending time interrupt to guest, hoping
guest OS itself can handle time interrupt lost and adjust time using
platform timer (e.g. HPET)'s counter.
"""

Empirically, timer mode of 0 makes Solaris SMP almost unusable. Timer
mode 0 makes it run OK. I've never been quite able to get my head around
exactly why it makes such a big difference. We use the TSC as the basis
of our hres timer by default, and there is code that implements
microsecond waits by busy-waiting for this value to reach a certain
point. My suspicion is that with timer_mode=0, we spend all of time
busy-waiting since the TSC doesn't jump forward to the host's TSC, but
that doesn't really explain why SMP is bad and UP is OK.

regards
john

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>