Skip to contentSkip to conversation

schedule_timeout_range()

RFC Bodo Eggert 2 participants 2 messages Jul 23, 2008 – Jul 24, 2008 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 3 lines · Nick Piggin

The only thing I dislike about explicit times is that when a driver or someone doesn't _really_ know how much to specify. Do you say 10s, 100s? It shouldn't be arbitrary, but we should have a few constants I think.

You'd replace "Should I use 10 or 100 seconds?" with "Should I use TIMEOUT_10_SEC or TIMEOUT_100_SEC?", while replacing "I want 40 seconds!" with "Danmed, I want 40 seconds, but that's not an option!".

BTW: If you don't know about which timeout you should use, you should think about mowing the lawn instead. ¢¢

#5 lore raw
Quoted 11 lines · Bodo Eggert
Quoted 3 lines · Nick Piggin

The only thing I dislike about explicit times is that when a driver or someone doesn't _really_ know how much to specify. Do you say 10s, 100s? It shouldn't be arbitrary, but we should have a few constants I think.

You'd replace "Should I use 10 or 100 seconds?" with "Should I use TIMEOUT_10_SEC or TIMEOUT_100_SEC?", while replacing "I want 40 seconds!" with "Danmed, I want 40 seconds, but that's not an option!".

BTW: If you don't know about which timeout you should use, you should think about mowing the lawn instead. ¢¢

It's not always that simple. If you code drivers or network protocols, it might seem easy, but a lot of the VM for example is riddled with rather arbitrary heuristics. Suppose we do slab cache reaping at 1HZ (for no really good reason)... what I want to do with that guy is to get maximum power savings when the CPU is idle, however I don't want to wait infinitely long because that's leaving work to do when the CPU finally does wake up, and it also ties up memory. I want the minimum timeout that gives maximum power saving (say, within 99.9% of theoretical maximum).

Can you tell me how to achieve this, or do you have lawn to mow too? ;)

OK, today we probably just add a few seconds of slop and forget about it, but actually in future if we might want to power down most of the system between key strokes, we might want 10s of seconds of sleep time.