- 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.
This commit is contained in:
Jeff Roberson 2004-12-26 07:30:35 +00:00
parent 37705f86ba
commit 6a98702001

View File

@ -101,11 +101,6 @@ userret(td, frame, oticks)
if (td->td_pflags & TDP_GEOM)
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.
@ -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);
}
/*