From: Thomas Gleixner <tglx@linutronix.de>
To: Stas Sergeev <stsp@aknet.ru>
Cc: "Magosányi Árpád" <m4gw4s@gmail.com>,
"Linux kernel" <linux-kernel@vger.kernel.org>
Subject: Re: hrtimer_get_res() problem (pcsp does not work)
Date: Mon, 26 May 2008 12:50:49 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.1.10.0805261249000.3295@apollo.tec.linutronix.de> (raw)
In-Reply-To: <48364469.5090400@aknet.ru>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2172 bytes --]
On Fri, 23 May 2008, Stas Sergeev wrote:
> Magosányi Árpád wrote:
> > code:
> > hrtimer_get_res(CLOCK_MONOTONIC, &tp);
> > + printk(KERN_INFO "PCSP: sec=%li, nsec=%linS\n",tp.tv_sec, tp.tv_nsec);
> >
> > output:
> > [ 22.882520] PCSP: sec=0, nsec=1nS
> > after an rmmod and modprobe:
> > [ 476.300571] PCSP: sec=0, nsec=1nS
> > after an rmmod, changing clocksource to tsc, and insmod:
> > [ 669.124557] PCSP: sec=0, nsec=1nS
> OK, thanks you.
> In this case I suspect this is not an
> snd-pcsp bug, but a hrtimer bug. Adding
> more people to CC.
>
> So what we have:
> ---
> I have a PIIX4 chipset, the full dmesg is attached.
> Note that it is an old 400Mhz pentium, and there is some problem with
> the timer source I use:
> [ 0.822740] * Found PM-Timer Bug on the chipset. Due to workarounds
> for a bug,
> [ 0.822750] * this clock source is slow. Consider trying other clock
> sources
> ---
> and (presumably) because of that PM-Timer
> Bug, snd-pcsp produces only the noice.
> dmesg said that the clock source is slow,
> yet the hrtimer_get_res() claims the
> resolution is 1nS. I think this is wrong,
> hrtimer_get_res() might be broken.
> Can someone please comment on that?
> Is hrtimer_get_res() known to return 1nS
> regardless of the real clock resolution?
It's not an hrtimer bug. The kernel internal time has nsec units.
The internal resolution of hrtimers is HZ when high resolution timers
are disabled or 1nsec when high resolution timers are available and
active.
We can not expose an exact resolution in this interface as this
depends on too many factors and it would be a horrible hackery to take
the theroetical resolution which results from the available clock
source and the resolution of the device which generates the timer
events into account in the hrtimer code. Even if we would expose an
interface which lets you know the exact resulting resolution there is
no guarantee that a timer meets its expiry time exactly.
The pmtimer bug is not causing the problems you have. It just slows
down the access to the pmtimer (instead of reading it straight we need
to read twice and do a sanity check).
Thanks,
tglx
prev parent reply other threads:[~2008-05-26 10:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <36d9c4070805171745y50c1648br553428d7a2b6373c@mail.gmail.com>
[not found] ` <483064A6.8040809@aknet.ru>
[not found] ` <36d9c4070805191222k7d873bffq41e17c989e8f0f3e@mail.gmail.com>
[not found] ` <48328330.7050707@aknet.ru>
[not found] ` <36d9c4070805201458v7d08b167ve2b72b1e8b3371a4@mail.gmail.com>
[not found] ` <48339B7F.2010307@aknet.ru>
[not found] ` <36d9c4070805211403h37b4d4ebj90c5ffad592fcffe@mail.gmail.com>
[not found] ` <4835CDD8.4020808@aknet.ru>
[not found] ` <36d9c4070805221837g21cd72c7l387f8a44004a064c@mail.gmail.com>
2008-05-23 4:13 ` Stas Sergeev
2008-05-26 10:50 ` Thomas Gleixner [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=alpine.LFD.1.10.0805261249000.3295@apollo.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=m4gw4s@gmail.com \
--cc=stsp@aknet.ru \
/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
all inboxes | Powered by JetHome®