diff options
author | jeff <jeff@FreeBSD.org> | 2003-04-11 03:39:07 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-04-11 03:39:07 +0000 |
commit | a033a840068cb5293a714269fd8d0f731259b542 (patch) | |
tree | bcd37429fc86aa97a6c5365898aad0fe73ea4633 /sys/kern/kern_exit.c | |
parent | 86d593d3bd77f9805c1cb64e1be8cb329014c3ea (diff) | |
download | FreeBSD-src-a033a840068cb5293a714269fd8d0f731259b542.zip FreeBSD-src-a033a840068cb5293a714269fd8d0f731259b542.tar.gz |
- Adjust sched hooks for fork and exec to take processes as arguments instead
of ksegs since they primarily operation on processes.
- KSEs take ticks so pass the kse through sched_clock().
- Add a sched_class() routine that adjusts a ksegrp pri class.
- Define a sched_fork_{kse,thread,ksegrp} and sched_exit_{kse,thread,ksegrp}
that will be used to tell the scheduler about new instances of these
structures within the same process. These will be used by THR and KSE.
- Change sched_4bsd to reflect this API update.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index fee6caf..fc967e9 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -494,6 +494,13 @@ exit1(struct thread *td, int rv) cpu_sched_exit(td); /* XXXKSE check if this should be in thread_exit */ /* + * Allow the scheduler to adjust the priority of the + * parent when a kseg is exiting. + */ + if (p->p_pid != 1) + sched_exit(p->p_pptr, p); + + /* * Make sure the scheduler takes this thread out of its tables etc. * This will also release this thread's reference to the ucred. * Other thread parts to release include pcb bits and such. @@ -575,17 +582,6 @@ loop: nfound++; if (p->p_state == PRS_ZOMBIE) { - /* - * Allow the scheduler to adjust the priority of the - * parent when a kseg is exiting. - */ - if (curthread->td_proc->p_pid != 1) { - mtx_lock_spin(&sched_lock); - sched_exit(curthread->td_ksegrp, - FIRST_KSEGRP_IN_PROC(p)); - mtx_unlock_spin(&sched_lock); - } - td->td_retval[0] = p->p_pid; #ifdef COMPAT_43 if (compat) |