diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2002-10-12 05:32:24 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2002-10-12 05:32:24 +0000 |
| commit | b43179fbe815b81e2d6bb729ffcb08e8f0a143da (patch) | |
| tree | 69991942d3c51153d9210031e7380779edf05aaf /sys/kern/subr_trap.c | |
| parent | bd26dcd10398fc7436ec5f3ee1a35ef5a7ae54dd (diff) | |
Notes
Diffstat (limited to 'sys/kern/subr_trap.c')
| -rw-r--r-- | sys/kern/subr_trap.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index c53edc305879..9f8bed0aa85a 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); |
