mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: tike64 <tike64@yahoo.com>
Cc: junjiec@gmail.com, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: realtime-preempt and arm
Date: Wed, 13 Dec 2006 13:36:00 -0500	[thread overview]
Message-ID: <1166034960.1785.10.camel@localhost.localdomain> (raw)
In-Reply-To: <304269.38734.qm@web59207.mail.re1.yahoo.com>

For -rt issues, please CC Ingo Molnar, and for High Res issues, please
CC Thomas Gleixner.


On Fri, 2006-12-01 at 01:07 -0800, tike64 wrote:
> > Hi,
> > 
> > Without the support of High Resolution Timer
> > supported, the timer resolution wouldn't change.
> 
> Ok, I understand that. I was not expecting more
> resolution. I expected only that I would get more
> precise 10ms delays. What confuses me is that the
> delays roughly doubled.
> 
> > With high-resolution-timer supported, our
> > arm926-based board could get resolution like
> 40~50us.
> > There are codes you can reference ,may be you should
> > just try to implement it.
> 
> It is good to know that the problem is not the arm
> architecture itself. Thanks to you for that.
> 
> The problem must be in the lh7a40x specific code or my
> configuration. I am not yet convinced enough that high
> resolution timer implementation would solve the
> problem. I don't need timing resolution finer than
> 10ms providing that FB doesn't blow it up to 60ms.
> 
> Could you or someone please give a hint where to look
> next or give an explanation why the lack of high
> resolution timer would behave like that.

Also, have you tried this with a nanosleep instead of a select.
Select's timeout is just that, a timeout. It's not suppose to be
accurate, as long as it doesn't expire early.  The reason I state this,
is that select uses a different mechanism than nanosleep, and that can
indeed affect the jitter.

Although without the high res enabled, you can't get better than jiffy
resolution, you shouldn't get a large jitter either.  BTW, using high
res won't help the select anyway. The select uses a normal
schedule_timeout, which means that it's not really expected to timeout,
but something should wake it up before hand. Which means that the good
old timer wheel (non-hrtimer) is going to do the waking of the process.
This means that you need to wait for the timer softirq to be scheduled
before your process wakes up. If there's a process with a higher
priority than the timer softirq running, then you need to wait.

Using nansleep uses the hrtimer code (available with out the high
resolutions).  The hrtimer uses its own timer softirq (softirq-hrtimer),
and it is special.  It inherits the priority of the task that created
the timer when the timer goes off.  Also, something like nanosleep,
won't even use the softirq, and will bypass the softirq all together,
and wake your process up from the interrupt.

So basically, don't use select for timing.

-- Steve



  reply	other threads:[~2006-12-13 18:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29  8:57 tike64
2006-11-30 15:56 ` junjiec
2006-12-01  9:07   ` tike64
2006-12-13 18:36     ` Steven Rostedt [this message]
2006-12-14  7:21       ` tike64
2006-12-14 10:00         ` Ingo Molnar
2006-12-14 10:26           ` tike64
2006-12-14 12:52             ` Steven Rostedt
2006-12-14 14:23               ` tike64
2006-12-14 15:20                 ` Steven Rostedt
2006-12-15  7:15                   ` tike64
2006-12-15  9:58                     ` Ingo Molnar
2006-12-15 13:00                       ` Steven Rostedt
2006-12-16  0:14 Robert Crocombe

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=1166034960.1785.10.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=junjiec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=tike64@yahoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome