From: Helge H. <hel...@ai...> - 2005-01-12 23:08:22
|
On Wed, Jan 12, 2005 at 04:40:05AM -0800, Hugo Vanwoerkom wrote: > > But I don't use top: wrote my own code: get it from > /proc/<pid>/stat > Is that data bad too? > Accuracy varies a lot between 2.4 and 2.6, due to the changed timer. The worst case is processes that do periodically work with short sleeps in between. If you want a good idea about how much "idle" time there is, do this: 1. Run your apps at normal priority for some time. 2. Run a cpu hog, something like " for (i=0;;) ++i;" at the lowest possible priority. Then check to see how much "work" the cpu hog manages to do (how far did it count, watch out for wraparound) in a given amount of time while the other stuff was running. If the cpu hog gets less works done under 2.6, then you can say that 2.6 has more overhead (or at least a different take on priority-based scheduling). Running the important program at realtime priority wil take care of even the scheduling differences, but requires root privileges. Helge Hafting |