Re: [patch 00/43] ktimer reworked

From: Roman Zippel
Date: Thu Dec 01 2005 - 19:32:10 EST


Hi,

On Thu, 1 Dec 2005, Steven Rostedt wrote:

> The name issue should never have been brought up,

Well, I haven't brought it up, I'm trying to get rid od it.


> > - reading time: to program a timer you have to read the time first,
> > reading jiffies is practically free, whereas reading the precise time can
> > be very expensive. With the right hardware it can be optimized to be quite
> > cheap, but if portability is important you may want to avoid the extra
> > cost.
>
> If you are only concerned with ms resolution, then the added expense of
> precise time is pretty negligible. And these times are still for usage
> with timers that are expected to expire. Remember that timeouts are still
> using jiffies.
>
> As for portablility, I believe John Stultz has some nice plugins coming
> to what timer source you want to use, so if there's a better way to get a
> time, these should make things easy to add.

These plugins can do no magic, if the hardware timer is slow, the whole
thing gets slow.

> > - calculations: jiffies is a long integer whereas ktime_t is 64bit, so if
> > you need a lot of complex time calculation, you should take the cost for
> > 32bit archs into account.
>
> Again, the cost is negligible for ms resolution. And we're getting close
> to 2038 so we need to be thinking in 64 bits anyway ;)

That one is not really an issue in the kernel, unless you want an uptime
of a hundred years.

> > - resolution: how precise must the timer be? jiffies can't represent time
> > values less than 1ms, but if time is e.g. measured in 10th of a second,
> > jiffies may be enough.
>
> And they would be if that is all you need. But coming from an embedded
> point of view, that is not nearly enough. I really see HighRes making it
> into the kernel soon, and any new code in this area really needs to take
> that into account.

I'm not against HR timer, I have a problem with using them as timer for
everything.

> > - timer life time: if only a short interval is needed (e.g. a fraction of
> > a second) timer_list is often a lot cheaper.
>
> And again, you are only limited to 1000 choices to go off in that fraction
> of a second if jiffies is the resolution (with jiffies an 1000HZ).

The point is still valid, short interval timer are cheaper using normal
timer, independent of whether they are removed or they expire.

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/