From: Arjan van de Ven <arjan@infradead.org>
To: James Yu <cyu021@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: jiffies doesn't increase while doing mdelay() ?
Date: Thu, 30 Mar 2006 15:23:47 +0200 [thread overview]
Message-ID: <1143725027.3062.4.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <60bb95410603292152l7597259dx28eaec77ebc5dfdf@mail.gmail.com>
On Thu, 2006-03-30 at 13:52 +0800, James Yu wrote:
> Dear all,
>
> I am doing the following in a kernel thread :
>
> ===== code segment=====
> prink("before mdelay:%d, ", jiffies);
> mdelay(300); // delay 300ms
> printk("after mdelay:%d\n", jiffies);
> ===== code segment=====
>
> However, jiffies before and after doing mdelay are the same!!!
> Can someone please explain why jiffies doesn't change ?
first of all you should use msleep() not mdelay() for such long
delays...
second if you have interrupts disables (for example via
spin_lock_irqsave) this is normal (and the reason why your code is
evil): The timer interrupt that normally increments jiffies can't happen
because you disabled it..
prev parent reply other threads:[~2006-03-30 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <60bb95410603292150r6448596clbef348e1bededdaf@mail.gmail.com>
2006-03-30 5:52 ` James Yu
2006-03-30 13:23 ` Arjan van de Ven [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=1143725027.3062.4.camel@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=cyu021@gmail.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®