[lkml]   [2006]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: gettimeofday order of magnitude slower with pmtimer, which is default
On Tuesday 21 March 2006 01:50, Andreas Mohr wrote:
> Hi,
> On Mon, Mar 20, 2006 at 01:24:49PM +0100, bert hubert wrote:
> > 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
> >
> > This problem has been discussed before
> >
> >
> > 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.
> I've been realizing this, too, when looking at some oprofile logs.
> pmtmr reading uses almost 3% CPU time (e.g. P3/700) when idle, and it's
> similarly problematic when not idle.
> I think it's crazy to do a safe tripled readout (with *very* expensive
> I/O!) of the PM timer unconditionally on *all* systems when only a
> (albeit not that small) subset of systems is affected by buggy (un-latched)
> PM timers.
> I want to improve things there; I can see three ways to do it:
> a) maintain a blacklist (or probably better a whitelist) of systems that
> are (not) affected
> b) detect long-time timer accuracy, then switch to fast readout if timer
> is verified to be accurate (no white/blacklist needed this way)
> c) give up on PM timer completely
> Any comments on which way and how this could/should be done?

The pm timer is very fast when the timer is latched and that strange loop uses
hardly any cpu time. The same can't be said about the unlatched timer case
where absurd amounts of cpu seem the norm. You have a catch 22 situation if
you depend on the accuracy of the pm timer only to end up wasting time trying
to actually use that timer.

Currently if you compile in pmtimer it is used by default. Perhaps when it's
detected that the timer is unlatched it should actually be used as a last
resort when all other timers have failed or it has been specified by
bootparam rather than the default timer. I figured having separate functions
for latched and unlatched timers would make more sense so that hardware with
good timers aren't unfairly disadvantaged by reading the time 2 more times
than necessary.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-03-20 16:43    [W:0.091 / U:1.288 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site