summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-10-10 00:04:55 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-10-10 00:04:55 +0000
commitdb316721f1e671c55b0a87d5a64203fbd6bf9cfd (patch)
tree13fb8bef0d81ea13ea4716164a8ba5b74bd5c958 /sys/kern
parent5be38eb7c8436b5a53d0e40eb5027e75d092fa78 (diff)
User land time accounting has changed when kernel spinning time was
introduced. Account spinning time to the process system time again. time(1) has no spinning, it only shows real, user, sys. OK visa@ mpi@ deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_clock.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 4c1057d00e3..b8c4608d238 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.95 2018/06/04 18:16:43 cheloha Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.96 2018/10/10 00:04:54 bluhm Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -378,9 +378,11 @@ statclock(struct clockframe *frame)
* so that we know how much of its real time was spent
* in ``non-process'' (i.e., interrupt) work.
*/
- if (spc->spc_spinning)
+ if (spc->spc_spinning) {
+ if (p != NULL && p != spc->spc_idleproc)
+ p->p_sticks++;
spc->spc_cp_time[CP_SPIN]++;
- else if (CLKF_INTR(frame)) {
+ } else if (CLKF_INTR(frame)) {
if (p != NULL)
p->p_iticks++;
spc->spc_cp_time[CP_INTR]++;