Re: [patch 00/43] ktimer reworked

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 01, 2005, at 16:51, Andrew Morton wrote:
Ingo Molnar <[email protected]> wrote:
we could merge the two by driving 'timeouts' via ktimers too - but there would be some unavoidable overhead to things like the TCP stack. But ktimers cannot be merged into timeouts, that's sure.

I think you guys have an advantage over me because you've been discussing and thinking about this terminology for months. IOW, your lips are moving but all I hear is blah, blah, blah ;)

For instance, when Kyle came out with his one-sentence description of timers versus timeouts, I thought he had them backwards. Only apparently he didn't.

So either it's all confusing, or I'm dumb, or both. I can evade investigation of that by claiming that we should seek something which is unconfusing to even dumb people.

I think part of this confusion was the little flamewar over naming. I think I can provide a succinct and simple description of this stuff, possibly as the start of some documentation:

In this patch there are two ways of setting up code to run at some point in the future: timers and timeouts.

A timeout (like waiting for somebody to answer the phone) is optimized to never happen (they will hopefully pick up first). If everything works perfectly; it will be stopped before it has a chance to go off.

A timer (like a kitchen timer telling you the cookies are done) is optimized to be added and sit around until it expires. You just don't turn off the timer and take the cookies out before they are done.

For the most part, you don't really care much about accuracy with a timeout. It needs to happen no earlier than the specified time, but if it occurs a second late, so what? The person might sit around waiting an extra few seconds for their friend to pick up, but that's not a major issue. On the other hand, you really *do* care about how accurate your timer is. If you wait an extra minute or two after the timer goes off before pulling the cookies from the oven, you have some rather inedible cookies.

IOW: leave timer_lists alone. Just add the needed new subsystem and use it.

I think that this is a relatively useful distinction to make, and perhaps we _should_ rename the subsystem and educate developers about the difference between timers and timeouts.

Cheers,
Kyle Moffett

--
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
  -- Brian Kernighan


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux