summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-10-17 12:25:38 +0000
committerbluhm <bluhm@openbsd.org>2018-10-17 12:25:38 +0000
commit4667466ef80c558d50be8ee6cf5ab029e11afb65 (patch)
tree07ae41855576b4847b1628b6ae13490626bdeaef
parent- add an example to date(1) showing how to convert between timezones (diff)
downloadwireguard-openbsd-4667466ef80c558d50be8ee6cf5ab029e11afb65.tar.xz
wireguard-openbsd-4667466ef80c558d50be8ee6cf5ab029e11afb65.zip
Only the scheduler time statistics should be affected by spinning.
Change the process time accounting back to the original code before spinning time was added. No change for scheduler time. Spinning interrupts are no longer accounted to process system time. input and OK visa@
-rw-r--r--sys/kern/kern_clock.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index b8c4608d238..e773752aee7 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.96 2018/10/10 00:04:54 bluhm Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.97 2018/10/17 12:25:38 bluhm Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -378,19 +378,18 @@ 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 (p != NULL && p != spc->spc_idleproc)
- p->p_sticks++;
- spc->spc_cp_time[CP_SPIN]++;
- } else if (CLKF_INTR(frame)) {
+ if (CLKF_INTR(frame)) {
if (p != NULL)
p->p_iticks++;
- spc->spc_cp_time[CP_INTR]++;
+ spc->spc_cp_time[spc->spc_spinning ?
+ CP_SPIN : CP_INTR]++;
} else if (p != NULL && p != spc->spc_idleproc) {
p->p_sticks++;
- spc->spc_cp_time[CP_SYS]++;
+ spc->spc_cp_time[spc->spc_spinning ?
+ CP_SPIN : CP_SYS]++;
} else
- spc->spc_cp_time[CP_IDLE]++;
+ spc->spc_cp_time[spc->spc_spinning ?
+ CP_SPIN : CP_IDLE]++;
}
spc->spc_pscnt = psdiv;