summaryrefslogtreecommitdiff
path: root/lib/libkvm
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-07-08 13:17:13 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-07-08 13:17:13 +0000
commit75518fa8eaa6911ea53a350c2d3e090ce8e963e3 (patch)
tree20ec444be8a846f99fdbb0816f5c2c758662a116 /lib/libkvm
parent544021728069ca351e05502774eabb3c0fed1d4f (diff)
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@
Diffstat (limited to 'lib/libkvm')
0 files changed, 0 insertions, 0 deletions