CVSROOT: /cvs Module name: src Changes by: clau...@cvs.openbsd.org 2024/07/08 07:17:12
Modified files: sys/kern : kern_acct.c kern_clock.c kern_exec.c kern_exit.c kern_proc.c kern_resource.c kern_sched.c kern_sysctl.c kern_time.c sched_bsd.c tty.c sys/sys : proc.h resourcevar.h sysctl.h Log message: Rework per proc and per process time usage accounting For procs (threads) the accounting happens now lockless by curproc using a generation counter. Callers need to use tu_enter() and tu_leave() for this. To read the proc p_tu struct tuagg_get_proc() should be used. It ensures that the values read is consistent. For processes only the time of exited threads is accumulated in ps_tu and to get the proper process time usage tuagg_get_process() needs to be called. tuagg_get_process() will sum up all procs p_tu plus the ps_tu. This removes another SCHED_LOCK() dependency. Adjust the code in exit1() and exit2() to correctly account for the full run time. For this adjust sched_exit() to do the runtime accounting like it is done in mi_switch(). OK jca@ dlg@