mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Alok Kataria <akataria@vmware.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	Daniel Hecht <dhecht@vmware.com>
Subject: Re: [PATCH 0/3] Improve TSC as a clocksource under VMware
Date: Tue, 21 Oct 2008 21:27:47 +0200	[thread overview]
Message-ID: <20081021192746.GJ12825@one.firstfloor.org> (raw)
In-Reply-To: <1224616236.6161.60.camel@alok-dev1>

On Tue, Oct 21, 2008 at 12:10:36PM -0700, Alok Kataria wrote:
> On Tue, 2008-10-21 at 11:15 -0700, Andi Kleen wrote:
> > > FWIU from the code, even if  cpu A's TSC is just 1 tick behind that of
> > > cpu B, we increment the nr_wraps value.
> > > And the code expects that there are no wraps in TSC throughout the
> > > 20msec measurement window.
> > > So IMO its fairly easy to fail this test.
> > 
> > Ok I think it would be better to enlarge the margin then to fix your
> > issue.
> > 
> 
> Yeah, i thought about that, but given the different kinds of native
> hardware that we have i think coming up with values that would be safe
> for all the cases would be difficult. And given that nobody has
> complained about this on native until now, i would prefer not to change

It would certainly be the better solution (or trusting the CPUID bit)

Hypervisors are pretty popular these days and there are many different
flavours and if each of them adds their own detection code Linux will soon 
get very crowded. It's just a non scalable bad solution.

> the status quo. Apart from that, even on VMware virtualized environment
> there can different configurations where this margin keeps on varying,
> under different scenarios, f.e. under overcommitment and all. So i don't
> think that changing threshold values maybe safe for all cases. 

When the margin changes then it likely won't be good enough for
gettimeofday(). There are a couple of testers for monotonity around,
would such a system with shifting marging surive running them
for a few days?


> 
> I think going with ignoring this check for specific systems is the best
> way to go further. 

Disagree.


> I hope you also agree with the CONSTANT_TSC check.

Yes constant_tsc is good, although the question is how much sanity 
check is still needed. I suspect even with it some sanity check
will still make sense.

And the question is if your HV even sets the bit?
Also you would need to change the Linux code to check it on Intel too.

-Andi

-- 
ak@linux.intel.com

  reply	other threads:[~2008-10-21 19:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21  1:35 Alok Kataria
2008-10-21  5:55 ` Chris Snook
2008-10-21 19:11   ` Alok Kataria
2008-10-22 19:26   ` Alok Kataria
2008-10-22 19:29     ` Jeff Hansen
2008-10-21  9:43 ` Andi Kleen
2008-10-21 16:41   ` Alok Kataria
2008-10-21 17:40     ` Andi Kleen
2008-10-21 18:04       ` Alok Kataria
2008-10-21 18:15         ` Andi Kleen
2008-10-21 19:10           ` Alok Kataria
2008-10-21 19:27             ` Andi Kleen [this message]
2008-10-21 19:47               ` Alok Kataria
2008-10-21 21:41                 ` Alok Kataria
2008-10-22 19:23               ` [PATCH] Skip tsc synchronization checks if CONSTANT_TSC bit is set Alok Kataria
2008-10-22 19:26                 ` Ingo Molnar
2008-10-22 19:30                   ` Alok Kataria
2008-10-22 20:17                   ` Andi Kleen
2008-10-22 22:04                     ` Alok Kataria
2008-10-22 19:58                 ` Andi Kleen
2008-10-22 22:00                   ` Alok Kataria
2008-10-22 22:13                     ` Andi Kleen
2008-10-22 22:11                       ` Alok Kataria
2008-10-22 22:54                         ` Andi Kleen
2008-10-23  2:21                           ` Alok Kataria
2008-10-23  8:10                             ` Andi Kleen
2008-10-23 23:39                               ` Alok Kataria
2008-10-23 23:47                                 ` H. Peter Anvin
2008-10-24  0:25                                   ` Andi Kleen
2008-10-24  0:46                                     ` H. Peter Anvin
2008-10-24  7:23                                       ` Andi Kleen
2008-10-24 15:30                                         ` H. Peter Anvin
2008-10-24 19:25                                           ` Andi Kleen
2008-10-24 19:19                                             ` H. Peter Anvin
2008-10-24 19:34                                               ` Andi Kleen
2008-10-24 19:50                                                 ` Alok Kataria
2008-10-24 20:18                                             ` Dan Hecht
2008-10-24  1:12                                   ` Alok Kataria
2008-10-24  1:18                                     ` H. Peter Anvin
2008-10-22 22:15                     ` Alan Cox
2008-10-22 22:17                       ` Alok Kataria
2008-10-21  9:50 ` [PATCH 0/3] Improve TSC as a clocksource under VMware Pavel Machek
2008-10-21 16:48   ` Alok Kataria
2008-10-21 18:36     ` Pavel Machek

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=20081021192746.GJ12825@one.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=akataria@vmware.com \
    --cc=dhecht@vmware.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®