> btw, we could do _exact_ process accounting if we want to, at the price of
> ~10-15 cycles per schedule(). we can just read the cycle counter (industry
> standard on most leading CPUs ;), add the delta to the process and do the
> math later, whenever someone (top) tries to access the values. This way we
> could even differentiate between IRQ cycles, kernel cycles, kernel thread
> cycles, idle cycles and user-space cycles. Is this an important and
> fundamental enough feature to justify those 10-15 cycles?
IMHO it would be very useful to smart scheduling algorithms, but this is
certainly a post-2.2 issue.
Anyway, for 2.1 I propose the following two simple changes:
o Introduce a switch count to each process. This should make all the
time eaters visible which was the point of Pavel's patch. Precise
accounting of time spent probably requires per-switch TSC reads.
o Add current time to /proc/<pid>/stat, making corrections
of time shifts between stat reads of different processes without
zillions of calls to gettimeofday() possible.
Have a nice fortnight
-- Martin `MJ' Mares <mj@ucw.cz> http://atrey.karlin.mff.cuni.cz/~mj/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "System going down at 1:45 for disk crashing."- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu