All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Winchell <dwinchell@virtualiron.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: "Shan, Haitao" <haitao.shan@intel.com>,
	Dave Winchell <dwinchell@virtualiron.com>,
	xen-devel@lists.xensource.com, "Dong,
	Eddie" <eddie.dong@intel.com>,
	"Jiang, Yunhong" <yunhong.jiang@intel.com>
Subject: Re: [PATCH] Add a timer mode that disables pending missed ticks
Date: Thu, 08 Nov 2007 09:43:16 -0500	[thread overview]
Message-ID: <47332084.8090305@virtualiron.com> (raw)
In-Reply-To: <C3587454.101C7%Keir.Fraser@cl.cam.ac.uk>

Hi Keir,

I've added comments below.
See my next mail on some interesting performance numbers.

thanks,
Dave

Keir Fraser wrote:

>On 7/11/07 19:38, "Dave Winchell" <dwinchell@virtualiron.com> wrote:
>
>  
>
>>My feeling is that we should go full SYNC. Yes, in theory the
>>guests should be able to handle ASYNC, but in reality it appears that
>>some do not. Since it is easy for us to give them SYNC,
>>lets just do it and not stress them out.
>>    
>>
>
>One problem with pure SYNC is there's a fair chance you won't deliver any
>ticks at all for a long time, if the guest only runs in short bursts (e.g.,
>I/O bound) and happens not to be running on any tick boundary. I'm not sure
>how much that matters. It could cause time goes backwards if the time
>extrapolation via the TSC is not perfectly accurate, or cause problems if
>there are any assumptions that TSC delta since last tick fits in 32 bits
>(less likely in x64 code I suppose). Anyway, my point is that only testing
>VCPUs under full load may cause us to optimise in ways that have nasty
>unexpected effects for other workloads.
>  
>
I agree that this could be a problem. I have an idea that could give us full
SYNC and eliminate the long periods without clock interrupts.
In pt_process_missed_ticks() when missed_ticks > 0 set pt->run_timer = 1.
In pt_save_timer():

    list_for_each_entry ( pt, head, list )
        if(!pt->run_timer)
             stop_timer(&pt->timer);

And in pt_timer_fn():

    pt->run_timer = 0;

So, for a guest that misses a tick, we will interrupt him once from the
descheduled state and then leave him alone in the descheduled state.

>  
>
>>For default mode as checked into unstable is now,
>>64 bit guests should run quite fast as missed is calculated and then a bunch
>>of additional interrupts are delivered. On the other hand
>>32bit guests very well in default mode.
>>
>>For the original code, before we put in the constant tsc offset business,
>>64bit guests run poorly and 32bit quests very well time-wise.
>>    
>>
>
>The default mode hasn't changed. Are you under the impression that
>missed-ticks-but-no-delay-of-tsc is the default mode now? I know x64 guests
>run badly with that because they treat every one of the missed ticks they
>receive as a full tick.
>  
>
Sorry, I was confused.
However, the default mode will still run poorly for 64 bit guests because
of the pending_nr's accumulated while the guest has interrupts disabled.
As I recall, the effect is quite large, on the order of 10% error.
I'll get you a number later today.

> -- Keir
>
>  
>
>>>Or is the lack of
>>>synchronization of TSCs across VCPUs causing issues that you're trying to
>>>avoid?
>>>      
>>>
>>This does cause issues, but its not the only contributor to poor timing.
>>Having TSCs synchronized across vcpus will help some of the time going
>>backwards problems we have seen, I think.
>>
>>Regards,
>>Dave
>>
>>Keir Fraser wrote:
>>
>>    
>>
>>>On 7/11/07 17:29, "Keir Fraser" <Keir.Fraser@cl.cam.ac.uk> wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>So, you can see we send an interrupt immediately (and ASYNC) if any ticks
>>>>have been missed, but then successive ticks are delivered 'on the beat'. A
>>>>possible middleground? Or perhaps we should just go with SYNC after all...
>>>>   
>>>>
>>>>        
>>>>
>>>How do these Linux x64 guests fare with the original and default timer mode,
>>>by the way? I would expect that time should be accounted pretty accurately
>>>in that mode, albeit with more interrupts than you'd like. Or is the lack of
>>>synchronisation of TSCs across VCPUs causing issues that you're trying to
>>>avoid?
>>>
>>>-- Keir
>>>
>>>
>>> 
>>>
>>>      
>>>
>
>
>  
>

  reply	other threads:[~2007-11-08 14:43 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 14:28 [PATCH] Add a timer mode that disables pending missed ticks Shan, Haitao
2007-10-30 16:12 ` Keir Fraser
2007-10-30 21:16   ` Dave Winchell
2007-10-31  7:09     ` Keir Fraser
2007-11-01 21:14       ` Dave Winchell
2007-11-01 21:21         ` Dave Winchell
2007-11-02  9:40         ` Keir Fraser
2007-11-02 15:51           ` Dave Winchell
2007-11-02 16:14             ` Keir Fraser
2007-11-02 16:35               ` Keir Fraser
2007-11-02 18:05               ` Dave Winchell
2007-11-03 21:17                 ` Dave Winchell
2007-11-03 22:31                   ` Keir Fraser
2007-11-05 14:36                     ` Dave Winchell
2007-11-07 14:39                       ` Dave Winchell
2007-11-07 14:39                         ` Keir Fraser
2007-11-07 16:23                           ` Dave Winchell
2007-11-07 17:10                             ` Keir Fraser
2007-11-07 17:29                               ` Keir Fraser
2007-11-07 17:47                                 ` Keir Fraser
2007-11-07 19:38                                   ` Dave Winchell
2007-11-08  8:07                                     ` Keir Fraser
2007-11-08 14:43                                       ` Dave Winchell [this message]
2007-11-08 14:53                                         ` Keir Fraser
2007-11-08 15:08                                           ` Dave Winchell
2007-11-09 19:22                                           ` Dave Winchell
2007-11-10 10:55                                             ` Keir Fraser
2007-11-12 15:37                                               ` Dave Winchell
2007-11-26 20:57                                               ` Dave Winchell
2007-12-06 11:57                                                 ` Keir Fraser
2007-12-19 18:57                                                   ` Dan Magenheimer
2007-12-19 19:32                                                     ` Dave Winchell
2008-01-03 22:57                                                       ` Dan Magenheimer
2008-01-03 23:24                                                         ` Dave Winchell
2008-01-04 23:24                                                         ` Dave Winchell
2008-01-08 14:33                                                           ` Keir Fraser
2008-01-09 16:53                                                             ` Dave Winchell
2008-01-09 17:19                                                               ` Dan Magenheimer
2008-01-09 19:14                                                                 ` Keir Fraser
2008-01-25 23:50                                                               ` Dan Magenheimer
2008-01-27 21:21                                                                 ` Dave Winchell
2008-01-28  0:29                                                                   ` Dan Magenheimer
2008-01-28 15:21                                                                     ` Dave Winchell
2008-01-29 22:34                                                                       ` Dan Magenheimer
2008-01-30 15:25                                                                         ` Dave Winchell
2008-01-30 21:04                                                                           ` Deepak Patel
2008-01-30 21:44                                                                             ` Dave Winchell
2008-02-01 22:31                                                                               ` Dan Magenheimer
2008-02-04 20:07                                                                                 ` Dave Winchell
2008-02-08 21:21                                                                                   ` Dave Winchell
2008-02-11 16:52                                                                                     ` Dave Winchell
2008-02-14 15:59                                                                                       ` Dave Winchell
2008-02-14 16:21                                                                                         ` Dan Magenheimer
2008-02-14 17:55                                                                                           ` Dave Winchell
2008-02-15 16:46                                                                                             ` Dan Magenheimer
2008-02-15 17:28                                                                                               ` Dave Winchell
2008-02-19 15:26                                                                                                 ` Dave Winchell
2008-02-19 17:55                                                                                                   ` Dan Magenheimer
2008-02-19 19:29                                                                                                     ` Keir Fraser
2008-02-19 20:50                                                                                                     ` Dave Winchell
2008-02-19 23:38                                                                                                       ` Dan Magenheimer
2008-02-20 23:40                                                                                                         ` Dan Magenheimer
2008-02-25 16:42                                                                                                       ` Dan Magenheimer
2008-02-25 20:01                                                                                                         ` (progress on hpet accuracy) and " Dave Winchell
2008-02-26  8:26                                                                                                           ` Keir Fraser
2008-02-26 14:45                                                                                                             ` Dave Winchell
2008-02-26 14:56                                                                                                               ` Keir Fraser
2008-02-26 15:49                                                                                                                 ` Dave Winchell
2008-03-05 15:06                                                                                                                 ` Dave Winchell
2008-03-05 15:20                                                                                                                   ` Keir Fraser
2008-03-05 17:25                                                                                                                     ` Dave Winchell
2008-03-05 17:21                                                                                                                       ` Keir Fraser
2008-03-05 17:42                                                                                                                         ` Dave Winchell
2008-03-05 17:53                                                                                                                           ` Dan Magenheimer
2008-03-06 23:36                                                                                                         ` Dan Magenheimer
2007-12-19 19:40                                                     ` Dave Winchell
2007-11-08 14:57                                         ` Dave Winchell
2007-10-31  3:10   ` Shan, Haitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47332084.8090305@virtualiron.com \
    --to=dwinchell@virtualiron.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=eddie.dong@intel.com \
    --cc=haitao.shan@intel.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yunhong.jiang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.