From: David Brownell <david-b@pacbell.net>
To: Sakari Ailus <sakari.ailus@nokia.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: 32 kHz timer granularity when CONFIG_NO_HZ is enabled
Date: Wed, 22 Oct 2008 12:06:19 -0700 [thread overview]
Message-ID: <200810221206.19642.david-b@pacbell.net> (raw)
In-Reply-To: <48FF26DE.4060107@nokia.com>
On Wednesday 22 October 2008, Sakari Ailus wrote:
> Hi,
>
> I have OMAP 3 and I'm using the 32 kHz timer, CONFIG_OMAP_32K_TIMER_HZ
> is set to 128 and CONFIG_NO_HZ is enabled. Many OMAP-based boards in
> arch/arm/config seem to have this kind of default configuration.
>
> This has the effect that for example msleep(1) sleeps much longer than
> intended, between 7,8 and 15,6 ms, for no apparent good reason.
1000 ms/sec / 128 HZ/sec == 7.8 ms/HZ
The "good reason" is that msleep() takes at least one HZ,
since it's based on the scheduler's use of jiffies.
> I'm just wondering whether all this is intentional. :-)
A patch to make msleep() use hrtimers didn't fly; the
change in semantics could make trouble, despite the
acknowledged problems of using jiffies instead of wall
clock time.
I can think of several semantic variants of msleep that
might be wanted:
msleep_deferrable() ... still HZ based, but ok to defer
the tick for IRQ reduction
msleep_exact() ... uses hrtimers, almost certainly
costs an IRQ (unless HIGH_RES_TIMERS is off)
msleep_fuzzy() ... current semantics, units of jiffies
but not deferrable
Folk seem mostly content with fuzzy() for now, although
there are certainly folk who'd rather have exact(). And
the slowdown of an msleep(1) is probably the canonical
example of why exact() would collect users.
- Dave
prev parent reply other threads:[~2008-10-22 19:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 13:13 32 kHz timer granularity when CONFIG_NO_HZ is enabled Sakari Ailus
2008-10-22 19:06 ` David Brownell [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=200810221206.19642.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-omap@vger.kernel.org \
--cc=sakari.ailus@nokia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.