Messages in this thread | | | Date | Wed, 04 May 2011 16:30:58 +0200 | From | Clemens Ladisch <> | Subject | Re: msleep() an load average |
| |
Eibach, Dirk wrote: > > Uninterruptible sleeps count as I/O load. > > Is there any practical reason behind this or was it just an igenious > invention to annoy those smug userspace developers?
Historically, uninterruptible sleeps were the best way to detect I/O load. Furthermore, a process that is doing I/O is very likely to continue running soon, while other sleeps are more likely to indicate that the process is waiting for some event to wake it up to begin doing something, so this better predicts CPU load. Finally, a busy device is likely to prevent other programs from running well, so it makes sense to count this against the load.
msleep() is commonly used to handle device communication delays, which is essentially the same case as waiting for disk I/O. It might be possible to introduce some new flags or functions to allow long uninterruptible sleeps that do not affect the load, but this has not been necessary so far because knowledge of this quirk of the load heuristic is necessary for every great kernel hacker. ;-)
Regards, Clemens
| |