lkml.org 
[lkml]   [2004]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Initial bits to help pull jiffies out of drivers
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
=============================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.062 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site