LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: John <shill@free.fr>
Cc: linux-kernel@vger.kernel.org, tglx@timesys.com, mingo@elte.hu,
	akpm@osdl.org
Subject: Re: One-shot high-resolution POSIX timer periodically late
Date: Thu, 25 Jan 2007 14:19:03 -0800	[thread overview]
Message-ID: <1169763543.5396.12.camel@localhost.localdomain> (raw)
In-Reply-To: <45B87F9A.9060201@free.fr>

On Thu, 2007-01-25 at 10:59 +0100, John wrote:
> John Stultz wrote:
> > On Wed, 2007-01-24 at 10:41 +0100, John wrote:
> >> As you can see, the first diagnostic came at 472.410501014... Then
> >> another diagnostic almost exactly two seconds apart 9 times in a row!
> >>
> >> My process is the only SCHED_FIFO process on the system. There are no
> >> user-space processes with a higher priority. AFAICT, only a kernel
> >> thread could keep the CPU away from my app.
> >>
> >> Is there a periodic kernel thread that runs every 2 seconds, cannot be
> >> preempted, and runs for over 50 µs??
> > 
> > This sounds like a BIOS SMI issue. Can you reproduce this behavior on
> > different hardware?
[snip]
> Do PCs typically enter System Management Mode periodically?

Completely depends on the system hardware and BIOS.

> Is it possible to disable SMM?

Not usually. Sometimes some SMIs can be disabled via BIOS options.

> According to the Wikipedia article, even the kernel is unaware that
> the CPU has entered SMM, is that correct?

Yes. The kernel has no notification that the SMI occurred.

> I've run my tests on a Dell PC. IIRC, the BIOS options are very basic.
> 
> I'll also try another PC as you suggest.

Also do check the -rt tree as Ingo suggested. I mis-read your earlier
email and thought you were running it.


> +++++
> 
> On a related note, John, AFAIU, you wrote the GTOD infrastructure. In my 
> app, I need to call clock_gettime(CLOCK_MONOTONIC, ...) very often, i.e. 
> around 2000 times every second (when I receive a packet, and when I 
> re-send a packet). Is there a way to improve the overhead / latency of 
> these calls? I've heard about vsyscalls, are they relevant?
> 
> Do I need a specific glibc to use vsyscalls?

vsyscalls are only supported on x86_64/powerpc (I think) right now.
glibc support is necessary, and right now its only for gettimeofday()
not clock_gettime().

> If I call clock_gettime(CLOCK_MONOTONIC, &spec) twice in a row, then 
> subtract the two timespecs, I get ~1400 ns on a 2.8 GHz P4. AFAIU, my 
> clock source is acpi_pm. I tried setting it to tsc but it made hell 
> break loose.
> 
> http://groups.google.com/group/fa.linux.kernel/msg/a095241d49adfc44?dmode=source
> 
> Apparently, 1400 ns is similar to what you observe with acpi_pm.
> I suppose I'll need to use the TSC if I want any improvement?

Yea, unfortunately the ACPI PM is much slower then the TSC.
However, the TSC is often unstable, so you might not be able to utilize
it.

You can play around w/ the "idle=poll" boot option to see if that allows
you to use it, but that will up your power usage and has possible
thermal risks.

thanks
-john



  reply	other threads:[~2007-01-25 22:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.NwnlFyMPfa3XG6my3HKGWnCW3x4@ifi.uio.no>
     [not found] ` <fa.Ji4GnAbBF2FR5JbSxvxn2haJZIk@ifi.uio.no>
2007-01-25  9:59   ` John
2007-01-25 22:19     ` john stultz [this message]
     [not found]   ` <fa.8TBiwbgs8B881k+3X+IlFjhqpLI@ifi.uio.no>
2007-01-25 12:03     ` John
     [not found] <fa.4zD54Ie6Ozt0P4YqQSicS+XzXGw@ifi.uio.no>
     [not found] ` <fa.G+/T32f2o1M3+YGLca/O8NaAQyY@ifi.uio.no>
     [not found]   ` <fa.6Ua8xjNfLKQEZZgDsoJgPMyww4g@ifi.uio.no>
     [not found]     ` <fa.yQlV+WU0TgrJTVqjopa01tgCnT0@ifi.uio.no>
     [not found]       ` <fa.ucVrLJ1Lh6FjdBHRglsIUc8/evk@ifi.uio.no>
     [not found]         ` <fa.Id9oufyELrVbe5Wb8SRakwC0V50@ifi.uio.no>
2007-02-01 10:18           ` John
2007-02-06 12:37             ` Ingo Molnar
2007-02-07 10:13               ` John
2007-02-05 16:37           ` John
2007-02-06  7:31             ` Peter Zijlstra
2007-02-07 10:25               ` John
2007-02-08 17:32                 ` Thomas Gleixner
2007-02-09 15:25                   ` John
2007-02-09 16:21                     ` Benedikt Spranger
2007-02-09 16:43                     ` Thomas Gleixner
     [not found] <fa.mtUvfgenNQkCc8835prYbwyiPQs@ifi.uio.no>
     [not found] ` <fa.lwkMc548uRMcUjd9KZ2pC1DMKT4@ifi.uio.no>
     [not found]   ` <fa.dTtI0ctv1nu+tCWiK6jGPnrX69k@ifi.uio.no>
     [not found]     ` <fa.CMU3scpnLxfHVWRFPcmfRl2CjhA@ifi.uio.no>
2007-01-30 17:38       ` John
2007-01-30 20:25         ` Ingo Molnar
     [not found] <45B729AF.4030701@privacy.net>
2007-01-24 19:02 ` john stultz
2007-01-24 20:09   ` Ingo Molnar

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=1169763543.5396.12.camel@localhost.localdomain \
    --to=johnstul@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=shill@free.fr \
    --cc=tglx@timesys.com \
    --subject='Re: One-shot high-resolution POSIX timer periodically late' \
    /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

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).