summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-05-25 18:11:11 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-05-25 18:11:11 +0000
commit4fe3ad0705acbd827d55d19802904e6d401c4d6e (patch)
treee6c4ebaae53788861df9a04371a97253698185fc /sys/kern
parentbebbfbcf65120b91c8551bbe1c2bc8d91f7d0882 (diff)
Do not account spinning time as running time when a thread crosses a
tick boundary of schedlock(). This reduces the contention on the SCHED_LOCK() when the current thread is already spinning. Prompted by deraadt@, ok visa@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sched_bsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c
index 00a08861b59..95c3bc23ef0 100644
--- a/sys/kern/sched_bsd.c
+++ b/sys/kern/sched_bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sched_bsd.c,v 1.50 2019/02/26 14:24:21 visa Exp $ */
+/* $OpenBSD: sched_bsd.c,v 1.51 2019/05/25 18:11:10 mpi Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*-
@@ -542,7 +542,7 @@ schedclock(struct proc *p)
struct schedstate_percpu *spc = &ci->ci_schedstate;
int s;
- if (p == spc->spc_idleproc)
+ if (p == spc->spc_idleproc || spc->spc_spinning)
return;
SCHED_LOCK(s);