tech-kern archive

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

Re: nanosleep() for shorter than schedule slice



In article <3e9dfc2e-418b-6006-72c6-25892b0b55ad%kardel.name@localhost>,
Frank Kardel  <kardel%kardel.name@localhost> wrote:
>Hi !
>
>
>I am pretty skeptical by the hardwired constant of 20 (clockticks). At 
>the usual/common clock interrupt rate of 100 Hz this is 200ms.
>
>So any nanosleep below 200ms will be a kernel busy loop...
>
>For sleeps less than 1 (at most two) clock ticks this would be a crude 
>workaround until we have better mechanisms like timed 
>interrupts/tickless kernel.
>
>With today processors 20ms is a LONG time, busy waiting wastes a lot of 
>otherwise useful cycles/power. Setting up a timed interrupt should be 
>well below 100us using todays HW and taking the interrupt also (save for 
>16MHz 68020 machines and similar ones).

This should not be a fixed constant, it should be related to HZ and quantum.

christos



Home | Main Index | Thread Index | Old Index