summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-10-12 05:32:24 +0000
committerjeff <jeff@FreeBSD.org>2002-10-12 05:32:24 +0000
commitef4d4e378e012b3efd909e2abc5c1ddcf38faee7 (patch)
tree69991942d3c51153d9210031e7380779edf05aaf /sys/kern/subr_trap.c
parentcf318b70e5aa88b25cdf3d47eacce75c5aa889db (diff)
downloadFreeBSD-src-ef4d4e378e012b3efd909e2abc5c1ddcf38faee7.zip
FreeBSD-src-ef4d4e378e012b3efd909e2abc5c1ddcf38faee7.tar.gz
- Create a new scheduler api that is defined in sys/sched.h
- Begin moving scheduler specific functionality into sched_4bsd.c - Replace direct manipulation of scheduler data with hooks provided by the new api. - Remove KSE specific state modifications and single runq assumptions from kern_switch.c Reviewed by: -arch
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index c53edc3..9f8bed0 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -53,6 +53,7 @@
#include <sys/kse.h>
#include <sys/ktr.h>
#include <sys/resourcevar.h>
+#include <sys/sched.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/vmmeter.h>
@@ -73,7 +74,6 @@ userret(td, frame, oticks)
{
struct proc *p = td->td_proc;
struct kse *ke = td->td_kse;
- struct ksegrp *kg = td->td_ksegrp;
CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid,
p->p_comm);
@@ -95,19 +95,9 @@ userret(td, frame, oticks)
#endif
/*
- * XXX we cheat slightly on the locking here to avoid locking in
- * the usual case. Setting td_priority here is essentially an
- * incomplete workaround for not setting it properly elsewhere.
- * Now that some interrupt handlers are threads, not setting it
- * properly elsewhere can clobber it in the window between setting
- * it here and returning to user mode, so don't waste time setting
- * it perfectly here.
+ * Let the scheduler adjust our priority etc.
*/
- if (td->td_priority != kg->kg_user_pri) {
- mtx_lock_spin(&sched_lock);
- td->td_priority = kg->kg_user_pri;
- mtx_unlock_spin(&sched_lock);
- }
+ sched_userret(td);
/*
* We need to check to see if we have to exit or wait due to a
@@ -250,7 +240,7 @@ ast(struct trapframe *framep)
}
if (flags & KEF_NEEDRESCHED) {
mtx_lock_spin(&sched_lock);
- td->td_priority = kg->kg_user_pri;
+ sched_prio(td, kg->kg_user_pri);
p->p_stats->p_ru.ru_nivcsw++;
mi_switch();
mtx_unlock_spin(&sched_lock);
OpenPOWER on IntegriCloud