public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* gettimeofday order of magnitude slower with pmtimer, which is default
@ 2006-03-20 12:24 bert hubert
  2006-03-20 14:50 ` Andreas Mohr
  2006-03-21 19:34 ` john stultz
  0 siblings, 2 replies; 30+ messages in thread
From: bert hubert @ 2006-03-20 12:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: george

Hi everybody,

For my open source nameserver (http://www.powerdns.com) I need to do quite a
number of gettimeofday calls. I've pared it down to almost the bare minimum
of 1 gettimeofday per packet sent and received. With these calls, I can make
stats like http://ds9a.nl/tmp/rrd/ which my users need so they can verify
the proper performance of the nameserver.

Yesterday, together with Zwane, I discovered each gettimeofday call costs me
4 usec on some boxes and almost nothing on others. We did a fruitless chase
for vsyscall/sysenter happening but the problem turned out to be
CONFIG_X86_PM_TIMER.

This problem has been discussed before
http://www.ussg.iu.edu/hypermail/linux/kernel/0411.1/2135.html

Not only is the pm timer slow by design, it also needs to be read multiple
times to work around a bug in certain hardware.

What is new is that this option is now dependent on CONFIG_EMBEDDED. Unless
you select this option, the PM Timer will always be used.

Would a patch removing the link to EMBEDDED and adding a warning that while
this timer is of high quality, it is slow, be welcome?

Thanks.

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: gettimeofday order of magnitude slower with pmtimer, which is default
@ 2006-03-21  5:33 Albert Cahalan
  0 siblings, 0 replies; 30+ messages in thread
From: Albert Cahalan @ 2006-03-21  5:33 UTC (permalink / raw)
  To: bert.hubert, linux-kernel, george, andi, hirofumi, kernel

bert hubert writes:

> Not only is the pm timer slow by design, it also needs to be read
> multiple times to work around a bug in certain hardware.
>
> What is new is that this option is now dependent on CONFIG_EMBEDDED.
> Unless you select this option, the PM Timer will always be used.

Good. Fast but horribly buggy is NOT acceptable as a default.
Go ahead and tweak the settings on YOUR system. Run Gentoo.

I wasted a lot of time trying to figure out why my clock ran
about 1.414 (yes, square root of two) times faster than proper.
It turns out that a normal dual-core AMD box has TSCs that run
at randomly varying and fully independant rates. Before I found
a post to linux-kernel by an AMD employee explaining this, my
thought was that I was probably missing clock ticks from the
BIOS going into SMM mode. That was the problem the previous time
I had clock problems. (so I reduced HZ to 100, etc.)

I'm sure lots of people would never figure out why their clock
is running 41.4% faster than normal. They'd live with it, using
a physical clock mounted on the wall, or switch to a different OS.

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2006-03-30 16:02 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-20 12:24 gettimeofday order of magnitude slower with pmtimer, which is default bert hubert
2006-03-20 14:50 ` Andreas Mohr
2006-03-20 15:24   ` Con Kolivas
2006-03-21  1:26     ` OGAWA Hirofumi
2006-03-21  0:40       ` kernel
2006-03-21  2:59         ` OGAWA Hirofumi
2006-03-21  3:09           ` Con Kolivas
2006-03-21  8:53             ` Andreas Mohr
2006-03-21  9:06               ` Arjan van de Ven
2006-03-21 11:58               ` Con Kolivas
2006-03-21 12:04                 ` Arjan van de Ven
2006-03-21 12:07                   ` Con Kolivas
2006-03-21 19:23       ` john stultz
2006-03-21 21:19         ` OGAWA Hirofumi
2006-03-22  0:21           ` Con Kolivas
2006-03-22 18:49             ` [PATCH] PM-Timer: doesn't use workaround if chipset is not buggy OGAWA Hirofumi
2006-03-22 21:46               ` Andrew Morton
2006-03-23  7:31                 ` OGAWA Hirofumi
2006-03-23  7:49                   ` Andrew Morton
2006-03-23 17:04               ` Andreas Mohr
2006-03-23 18:21                 ` OGAWA Hirofumi
2006-03-30 11:53                   ` Andreas Mohr
2006-03-30 15:37                     ` OGAWA Hirofumi
2006-03-30 16:02                       ` Andreas Mohr
2006-03-25 12:00               ` bert hubert
2006-03-22 19:12           ` gettimeofday order of magnitude slower with pmtimer, which is default Avi Kivity
2006-03-22 19:54             ` OGAWA Hirofumi
2006-03-22 20:05             ` john stultz
2006-03-21 19:34 ` john stultz
  -- strict thread matches above, loose matches on Subject: below --
2006-03-21  5:33 Albert Cahalan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox