From: Tim Bird <tim.bird@am.sony.com>
To: Alan Cox <alan@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Initial bits to help pull jiffies out of drivers
Date: Mon, 02 Aug 2004 14:33:03 -0700 [thread overview]
Message-ID: <410EB30F.3060001@am.sony.com> (raw)
In-Reply-To: <20040727195939.GA20712@devserv.devel.redhat.com>
Alan Cox wrote:
> This is really for comment, the basic idea is to add some relative
> timer functionality. This gives us timeout objects as well as pulling
> jiffies use into one place in the timer code.
This is very welcome. Here are some random thoughts:
It looks like there are a few "jiffy-usage" idioms that this patch
deals with:
1. use of jiffies for timing debug output, in a printk
2. checking to see if a time period has elapsed or not
3. conversion from absolute time units to relative time units
4. conversion from polled timeout to sleep (msleep)
Your solution to 1) is to just remove the printk output:
> - printk("serdatr = %d (jiff=%lu)...", lsr, jiffies);
> + printk("serdatr = %d ...", lsr);
I have some code that allows one to configure the kernel so every
printk includes timing data (based on sched_clock(). I trim to
microsecond resolution on x86).
Would it be worth adding a feature like this to compensate
for removing the debug timing information?
Alternatively, I could cook up a macro using sched_clock() to provide
a substitute value to use to print timing info, in cases where it
was desirable to preserve it.
----
I noticed that some comments in the original code
are wrong based on an assumed value for HZ:
-static void moxadelay(int tick)
-{
- unsigned long st, et;
-
- st = jiffies;
- et = st + tick;
- while (time_before(jiffies, et));
-}
...
> - moxadelay(1); /* delay 10 ms */
> + msleep(10); /* delay 10 ms */
So reworking the code may give a nice comment cleanup, or possibly
clean up the code to actually delay the amount intended.
This is a nice side effect of this work.
=============================
Tim Bird
Architecture Group Co-Chair, CE Linux Forum
Senior Staff Engineer, Sony Electronics
E-mail: tim.bird@am.sony.com
=============================
next prev parent reply other threads:[~2004-08-02 21:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-27 19:59 Initial bits to help pull jiffies out of drivers Alan Cox
2004-08-02 21:33 ` Tim Bird [this message]
2004-08-02 21:52 ` Alan Cox
2004-08-03 8:27 ` Arjan van de Ven
[not found] <2mGr0-7w6-27@gated-at.bofh.it>
2004-08-02 23:35 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2004-08-05 13:57 Martin Schwidefsky
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=410EB30F.3060001@am.sony.com \
--to=tim.bird@am.sony.com \
--cc=alan@redhat.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