aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2004-12-26 07:30:35 +0000
committerJeff Roberson <jeff@FreeBSD.org>2004-12-26 07:30:35 +0000
commit6a98702001d1f03f6169acf6a2f29e8dabc9f84b (patch)
tree847221f4feaf8fe6bf027a11b74eeb64221348f7 /sys/kern/subr_trap.c
parent37705f86ba70b0430ac41931f4a2fe6052e7087f (diff)
downloadsrc-6a98702001d1f03f6169acf6a2f29e8dabc9f84b.tar.gz
src-6a98702001d1f03f6169acf6a2f29e8dabc9f84b.zip
- Run sched_userret() after thread_userret(). Before, sched_userret() would
lower the priority of the returning thread to a user priority before calling into thread_userret() which would call wakeup() which in turn would cause the returning thread to eventually context switch rather than completing its slice. Allowing this thread to complete its slice first yields a 15% performance improvement in super-smack on my dual opteron with 4BSD.
Notes
Notes: svn path=/head/; revision=139324
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 89fab494da45..96261e94e994 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -102,11 +102,6 @@ userret(td, frame, oticks)
g_waitidle();
/*
- * Let the scheduler adjust our priority etc.
- */
- sched_userret(td);
-
- /*
* We need to check to see if we have to exit or wait due to a
* single threading requirement or some other STOP condition.
* Don't bother doing all the work if the stop bits are not set
@@ -133,6 +128,10 @@ userret(td, frame, oticks)
ticks = td->td_sticks - oticks;
addupc_task(td, TRAPF_PC(frame), (u_int)ticks * psratio);
}
+ /*
+ * Let the scheduler adjust our priority etc.
+ */
+ sched_userret(td);
}
/*