summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-02-09 10:27:04 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-02-09 10:27:04 +0000
commit1872bfbf83c617ebcbe674d69858d971e7040e12 (patch)
treed4113eca0a5875b351b5d4eb2f6eff30be753a4b /sys/kern
parent180f29a2c42ef9f1e4564a2321227656d9cf732d (diff)
Do no select a CPU to execute the current thread when being preempt()ed.
Calling sched_choosecpu() at this moment often result in moving the thread to a different CPU. This does not help the scheduler and creates a domino effect, resulting in kernel thread moving to other CPUs. Tested by many without performance impact. Simon Mages measured a small performance improvement and a smaller variance with an http proxy. Discussed with kettenis@, ok martijn@, beck@, visa@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sched_bsd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c
index fa349bafaab..7e420bc25b7 100644
--- a/sys/kern/sched_bsd.c
+++ b/sys/kern/sched_bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sched_bsd.c,v 1.44 2017/01/25 06:15:50 mpi Exp $ */
+/* $OpenBSD: sched_bsd.c,v 1.45 2017/02/09 10:27:03 mpi Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*-
@@ -329,7 +329,6 @@ preempt(struct proc *newp)
SCHED_LOCK(s);
p->p_priority = p->p_usrpri;
p->p_stat = SRUN;
- p->p_cpu = sched_choosecpu(p);
setrunqueue(p);
p->p_ru.ru_nivcsw++;
mi_switch();