virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Zachary Amsden <zach@vmware.com>
Cc: virtualization@lists.osdl.org, Andrew Morton <akpm@osdl.org>,
	Chris Wright <chrisw@sous-sol.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/5] Skip timer works.patch
Date: Tue, 31 Oct 2006 00:50:51 +0100	[thread overview]
Message-ID: <200610310050.51912.ak@suse.de> (raw)
In-Reply-To: <454689C7.6030009@vmware.com>


> It doesn't happen often, but it is a possibility that the kernel 
> calibrates the delay wrong because of timing glitches caused by CPU 
> migration, paging, or other phenomena which are supposed to be 
> transparent to the kernel (but cause temporal lapse).

We're supposed to handle those because they happen on real hardware
too with long running SMM handlers. Or at least there was a effort some time ago
to do this. If it wasn't enough we'll likely need to fix the code.

> In that case, the  
> kernel may not make enough progress in a spin delay loop to properly 
> reach the number of microseconds required for N number of timer ticks to 
> occur.  

Hmm, mdelay is polling RDTSC and assumes it makes forward progress
and waits until the time that was estimated at the original TSC<->PIT
calibration passed.  While there is a spin loop it is definitely 
polling a timer that is supposed to tick properly even in virtualization.

You're saying that doesn't work on vmware? Does it have trouble
with RDTSC?

Anyways if polling against TSC doesn't work I suppose we could
change it to poll against some other timer.
 
> In theory this can happen on a real machine, as SMM mode could 
> be active, doing USB device emulation or something that takes a while 
> during the lpj calibration and throwing the computation off.

Yep.

> By changing the parameters (N ticks at K Hz in T seconds), it is easy to 
> create an unstable measurement that can achieve high failure rates, 
> although in practice the Linux parameters appear to be reasonable enough 
> that it is not a major problem.

Hmm, why exactly? 

-Andi

  reply	other threads:[~2006-10-30 23:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-20  0:09 [PATCH 1/5] Skip timer works.patch Zachary Amsden
2006-10-27 14:56 ` Andi Kleen
2006-10-27 19:09   ` Zachary Amsden
2006-10-27 21:16     ` Andi Kleen
2006-10-30 20:54       ` Zachary Amsden
2006-10-30 22:50         ` Andi Kleen
2006-10-30 23:09           ` Zachary Amsden
2006-10-30 23:12             ` Andi Kleen
2006-10-30 23:24               ` Zachary Amsden
2006-10-30 23:50                 ` Andi Kleen [this message]
2006-11-15  8:03           ` Chris Wright
2006-11-15  8:21             ` Zachary Amsden
2006-11-15 22:40               ` Chris Wright
2006-11-15 22:54                 ` Chris Wright
2006-11-16  3:27                 ` Andi Kleen
2006-11-16  3:37                   ` Chris Wright
2006-11-16  3:37                     ` Andi Kleen
2006-11-16  5:06                   ` Andrew Morton
2006-11-16  6:13                     ` Zachary Amsden
2006-11-16  7:23                       ` Andi Kleen
2006-11-16  7:02                     ` Andi Kleen
2006-11-16  7:16                       ` Chris Wright
2006-11-16  8:26                         ` Chris Wright
2006-11-16 10:28                     ` Chris Wright
2006-11-16 13:16                       ` Andi Kleen
2006-11-16 19:03                         ` Chris Wright
2006-11-16 19:46                           ` Andi Kleen
2006-11-16 20:24                             ` Chris Wright
2006-11-17  4:47                               ` Andi Kleen
2006-11-17  7:33                                 ` Chris Wright
2006-11-17  7:38                                   ` Andi Kleen
2006-11-16 22:53 ` Andrew Morton
2006-11-16 23:08   ` Zachary Amsden
2006-11-16 23:10   ` Chris Wright
2006-11-17  5:05   ` Andi Kleen

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=200610310050.51912.ak@suse.de \
    --to=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=chrisw@sous-sol.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    --cc=zach@vmware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).