[PATCH] precise time accounting using TSC for 2.2.14

From: Jan Astalos (astalos@tuke.sk)
Date: Fri Jan 28 2000 - 05:31:29 EST


This patch contains improved time accounting for uniprocessor machines
with TSC counter.

Problem: Accounting of process time is done in time handler every clock
tick. If process releases CPU before clock tick, used time is accounted
to next running process or idle process. It is possible to make process
that uses up to 30% of CPU time but is not reported to be running at
all.

Solution: To count short slices at context switch and to add accumulated
jiffies to utime in time handler. I tested it on my K6 and I didn't
noticed any nasty side effects. Tests are OK now...

Yes. Used time is still not split correctly, but sum of utime and stime
should be correct now. I don't want to put any additional overhead on
system calls. If someone will improve the patch, and/or rewrite it for
SMP machines, I would like to have a copy. Also, if I missed something
please send me a note (cc it to my address). Thanks.

Jan

PS: I know that everyone will read the patch before using it :-), but
just for the case: there is new parameter in kernel config in 'General
setup' group, active only if you select TSC machine and no SMP support.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:20 EST