Re: [patch 00/43] ktimer reworked

From: Steven Rostedt
Date: Thu Dec 01 2005 - 14:09:22 EST


On Thu, 2005-12-01 at 18:44 +0100, Roman Zippel wrote:
> Hi,
>
> On Thu, 1 Dec 2005, Russell King wrote:
...
> > Hence, timers have the implication that they are _expected_ to expire.
> > Timeouts have the implication that their expiry is an exceptional
> > condition.
>
> IOW a timeout uses a timer to implement an exceptional condition after a
> period of time expires.
>
> > So can we stop rehashing this stupid discussion?
>
> The naming isn't actually my primary concern. I want a precise definition
> of the expected behaviour and usage of the old and new timer system. If I
> had this, it would be far easier to choose a proper name.
> E.g. I still don't know why ktimeout should be restricted to raise just
> "error conditions", as the name implies.
>

ktimeout may not need to be restricted to anything.

It should just be documented simply as: If you need to set some timed
event to happen that you don't expect to occur then use a ktimeout.
Where this timed event is an event that lets you know that another event
hasn't happened in a given time. (I want to know if x didn't happen by
this time).

If a timed event is expected to occur then use ktimer. Where it is
mostly used for the event itself (I want x to happen at this time).

Now you could use ktimout on something that will always occur, but this
will just be inefficient, since ktimeout is optimized for removal and
not expiration. Which usually happens when something "times out".

And you could use ktimer on something that isn't going to occur. But
again this is just inefficient.

So Roman, please have someone else speak up and let us know that they
are just as confused on these names as you are. Currently, it seems
that you are the only one that doesn't understand the difference between
a timeout and a timer. You seem very intelligent and that could be why
you are getting confused. You're looking too deep into the
implementation of timers and timeouts, where they seem to use each
other. You just need to take a step back and look at this at a higher
view. Think about what to use when you need to implement being told
when something has timed out (timeout) or when you just want to do
something that happens a a certain time (timer).

-- Steve

-
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/