diff options
author | jeff <jeff@FreeBSD.org> | 2004-12-26 07:30:35 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2004-12-26 07:30:35 +0000 |
commit | 4739ea6908fee2a91079dac1f6ed80f2474b96b6 (patch) | |
tree | 847221f4feaf8fe6bf027a11b74eeb64221348f7 /sys/kern | |
parent | be8bad5c95be6bbbe6a5a6073bcfed12c2abfbdc (diff) | |
download | FreeBSD-src-4739ea6908fee2a91079dac1f6ed80f2474b96b6.zip FreeBSD-src-4739ea6908fee2a91079dac1f6ed80f2474b96b6.tar.gz |
- 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.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_trap.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 89fab49..96261e9 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); } /* |