From: Con Kolivas <kernel@kolivas.org>
To: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
Cc: bert hubert <bert.hubert@netherlabs.nl>,
linux-kernel@vger.kernel.org, george@mvista.com
Subject: Re: gettimeofday order of magnitude slower with pmtimer, which is default
Date: Tue, 21 Mar 2006 02:24:23 +1100 [thread overview]
Message-ID: <200603210224.23540.kernel@kolivas.org> (raw)
In-Reply-To: <20060320145047.GA12332@rhlx01.fht-esslingen.de>
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
> > 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.
>
> 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.
Cheers,
Con
next prev parent reply other threads:[~2006-03-20 15:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=200603210224.23540.kernel@kolivas.org \
--to=kernel@kolivas.org \
--cc=andi@rhlx01.fht-esslingen.de \
--cc=bert.hubert@netherlabs.nl \
--cc=george@mvista.com \
--cc=linux-kernel@vger.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