mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Elias Oltmanns <eo@nebensachen.de>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: udelay and timers
Date: Fri, 26 Sep 2008 11:42:33 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.1.10.0809261141350.27026@apollo.tec.linutronix.de> (raw)
In-Reply-To: <87skrnz6o0.fsf@denkblock.local>

On Fri, 26 Sep 2008, Elias Oltmanns wrote:

> Hi all,
> 
> finally, I have managed to identify the cause of some odd symptoms on my
> system, but I need your help to understand what is really going on and
> what should be done to fix things. My problem is this: I have written a
> small test module which, in due course, does the following:
> 
> ...
>         mod_timer(&timera, jiffies + msecs_to_jiffies(10000));
>         mod_timer(&timerb, jiffies + HZ/50);
> ...
> 
> The callbacks for those timers are defined as follows:
> 
> void timera.function(unsigned long data)
> {
>         udelay(120);
>         mod_timer(&timera, jiffies + msecs_to_jiffies(10000));
> }
> 
> void timerb.function(unsigned long data)
> {
> ...
>         mod_timer(&timerb, jiffies + HZ/50);
> }
> 
> Now, I can observe that because of the call to udelay() in the callback
> of timera, timerb rather frequently fires *much* too early, i.e. after
> less than 1 msec rather than 20 msecs. This means that an udelay in a
> timer callback heavily affects the precision of other timers running at
> the time. The effect if particularly grave on a tickless system, but
> even when NO_HZ was not set, I have observed this behaviour.
> 
> As I understand, udelay() is meant to be usable in softirq context. What
> can I do to find out what exactly causes the problem?

I have no idea what's going wrong. Can you please provide the full
source of your test module ?

Thanks,

	tglx

  reply	other threads:[~2008-09-26  9:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26  7:51 Elias Oltmanns
2008-09-26  9:42 ` Thomas Gleixner [this message]
2008-09-28  8:55   ` Elias Oltmanns

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.0809261141350.27026@apollo.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=eo@nebensachen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®