|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] timer_mode default change?!?
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
|
|
|
|
|