public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pete Wyckoff <pw@osc.edu>
To: Ingo Molnar <mingo@elte.hu>
Cc: dean gaudet <dean@arctic.org>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: nosmp/maxcpus=0 or 1 -> TSC unstable
Date: Wed, 16 Jan 2008 11:24:10 -0500	[thread overview]
Message-ID: <20080116162410.GB26898@osc.edu> (raw)
In-Reply-To: <20080116153137.GA18553@elte.hu>

mingo@elte.hu wrote on Wed, 16 Jan 2008 16:31 +0100:
> 
> * Pete Wyckoff <pw@osc.edu> wrote:
> 
> > > pretty sure this is the culprit is that num_possible_cpus() > 1, 
> > > which would mean cpu_possible_map contains the second cpu... but i'm 
> > > not quite sure what the right fix is... or perhaps this is all 
> > > intended.
> > 
> > We've seen the same problem.  We use gettimeofday() for timing of 
> > network-ish operations on the order of 10-50 us.  But not having the 
> > TSC makes gettimeofday() itself very slow, on the order of 30 us.
> 
> 30 usecs is too much - even with pmtimer it's typically below 5 usecs. 
> Could you run this on your box:
> 
>   http://people.redhat.com/mingo/time-warp-test/time-warp-test.c
> 
> and send back what it reports? (run it for a few minutes)

You're right.  That 30 us comes from an old comment.  Testing with
your code shows under 5 us as you expected.  I had to hack out the
#ifndef i386 error; compiling on x86-64.  Dual-socket 2.4 GHz
Opteron 250.  TSC-warps grows continually in all situations.

On 2.6.24-rc6 + scsi-misc + random stuff, 2 processors:

 | 0.39 us, TSC-warps:983002775 | 4.81 us, TOD-warps:0 | 4.81 us, CLOCK-warps:0 

With "maxcpus=1", no broken patch to force TSC:

 | 0.33 us, TSC-warps:679679972 | 3.30 us, TOD-warps:0 | 3.30 us, CLOCK-warps:0 

With "maxcpus=1", including my broken patch to force use of TSC in
this situation:

 | 0.05 us, TSC-warps:2884019968 | 0.45 us, TOD-warps:0 | 0.45 us, CLOCK-warps:0

For giggles, an older fedora kernel (2.6.23.1-42.fc8) gives:

 | 0.87 us, TSC-warps:575054334 | 8.67 us, TOD-warps:0 | 8.67 us, CLOCK-warps:0 

		-- Pete

      reply	other threads:[~2008-01-16 16:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12 19:48 nosmp/maxcpus=0 or 1 -> TSC unstable dean gaudet
2008-01-15 22:50 ` Pete Wyckoff
2008-01-16  4:13   ` Andi Kleen
2008-01-16 15:31   ` Ingo Molnar
2008-01-16 16:24     ` Pete Wyckoff [this message]

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=20080116162410.GB26898@osc.edu \
    --to=pw@osc.edu \
    --cc=dean@arctic.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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