mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jdavis@accessline.com
To: linux-kernel@vger.kernel.org
Subject: Odd Timer behavior in 2.6 vs 2.4  (1 extra tick)
Date: Fri, 8 Apr 2005 10:39:23 -0700	[thread overview]
Message-ID: <E29E71BB437ED411B12A0008C7CF755B2BC9BE@mail.accessline.com> (raw)



Hello, 

I've created a pretty straight forward timer using setitimer, and noticed
some odd differences between 2.4 and 2.6, I wonder if I could get a
clarification if this is the way it should work, or if I should continue to
try to "fix" it.

I create a RealTime Thread( SCHED_FIFO, maxPriority-1 ) (also tried
SCHED_RR) ...

that creates a timer ...setitimer( ITIMER_REAL, SIGALRM) with a 10 milli
period. (I've also tried timer_create with CLOCK_REALTIME and SIGRTMIN)

and then the thread does a sem_wait() on a semaphore. 

the signal handler does a sem_post() .


on 2.4.X the (idle) worst case latency is ~40 microseconds, 
on 2.6.X the (idle) latency is about the same plus 1 tick of the scheduler
~1000 micro seconds... Always.. Every time.
So to work around this on 2.6 I simply subtract 1 millisecond from my timer
as a fudge factor and everything works as expected.

I've tried compiling various kernels (2.6.9, 2.6.11) with kernel pre-empting
on, etc..

Is this the correct behavior? If so I'm curious who is using up the extra
Tick?
Does the asynch signal handler use up the whole tick even though it only has
to sem_post()?

I am not subscribed to the list, so I would appreciate a CC.
Thanks,
-JD

             reply	other threads:[~2005-04-08 17:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-08 17:39 jdavis [this message]
2005-04-08 22:19 ` Steven Rostedt
2005-04-21  2:58 ` [PATCH] Bad rounding in timeval_to_jiffies [was: Re: Odd Timer behavior in 2.6 vs 2.4 (1 extra tick)] Steven Rostedt
2005-04-21  3:40   ` Steven Rostedt
2005-04-21  8:51     ` Russell King
2005-04-21 10:51       ` Steven Rostedt
2005-04-21 14:58         ` Linus Torvalds
2005-04-21 15:34           ` Steven Rostedt
2005-04-21 15:53           ` Chris Friesen
2005-04-21 16:13             ` Linus Torvalds
2005-04-22  2:54               ` Edgar Toernig
2005-04-29 21:28 ` Odd Timer behavior in 2.6 vs 2.4 (1 extra tick) Nish Aravamudan

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=E29E71BB437ED411B12A0008C7CF755B2BC9BE@mail.accessline.com \
    --to=jdavis@accessline.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

all inboxes | Powered by JetHome®