summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-10-16 08:53:46 +0000
committerjeff <jeff@FreeBSD.org>2003-10-16 08:53:46 +0000
commit4aea3a9433e80a27ebfdc96bbf34edc628c9749b (patch)
tree58676b73754d9322936b32b75441e5fb2dec634e /sys/kern/kern_synch.c
parent991febf6dd83fc12812470ce7a43503ff2b86f2c (diff)
downloadFreeBSD-src-4aea3a9433e80a27ebfdc96bbf34edc628c9749b.zip
FreeBSD-src-4aea3a9433e80a27ebfdc96bbf34edc628c9749b.tar.gz
- Collapse sched_switchin() and sched_switchout() into sched_switch(). Now
mi_switch() calls sched_switch() which calls cpu_switch(). This is actually one less function call than it had been.
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 22dd49b..1b05640 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -457,9 +457,7 @@ mi_switch(void)
{
struct bintime new_switchtime;
struct thread *td;
- struct thread *newtd;
struct proc *p;
- u_int sched_nest;
mtx_assert(&sched_lock, MA_OWNED | MA_NOTRECURSED);
td = curthread; /* XXX */
@@ -510,18 +508,9 @@ mi_switch(void)
PCPU_SET(switchtime, new_switchtime);
CTR3(KTR_PROC, "mi_switch: old thread %p (pid %d, %s)", td, p->p_pid,
p->p_comm);
- sched_nest = sched_lock.mtx_recurse;
if (td->td_proc->p_flag & P_SA)
thread_switchout(td);
- sched_switchout(td);
-
- newtd = choosethread();
- if (td != newtd)
- cpu_switch(td, newtd); /* SHAZAM!! */
-
- sched_lock.mtx_recurse = sched_nest;
- sched_lock.mtx_lock = (uintptr_t)td;
- sched_switchin(td);
+ sched_switch(td);
/*
* Start setting up stats etc. for the incoming thread.
OpenPOWER on IntegriCloud