diff options
author | bde <bde@FreeBSD.org> | 2004-06-21 14:49:50 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2004-06-21 14:49:50 +0000 |
commit | 747f331358555b932b9b61ba8121c7e9b02e5283 (patch) | |
tree | e1a586f3638dc271edbad4a8e1398c99adfeae58 /sys/kern/kern_exit.c | |
parent | a3821a72ca21116115bcf1c86115a2387281c2ee (diff) | |
download | FreeBSD-src-747f331358555b932b9b61ba8121c7e9b02e5283.zip FreeBSD-src-747f331358555b932b9b61ba8121c7e9b02e5283.tar.gz |
(1) Removed the bogus condition "p->p_pid != 1" on calling sched_exit()
from exit1(). sched_exit() must be called unconditionally from exit1().
It was called almost unconditionally because the only exits on system
shutdown if at all.
(2) Removed the comment that presumed to know what sched_exit() does.
sched_exit() does different things for the ULE case. The call became
essential when it started doing load average stuff, but its caller
should not know that.
(3) Didn't fix bugs caused by bitrot in the condition. The condition was
last correct in rev.1.208 when it was in wait1(). There p was spelled
curthread->td_proc and was for the waiting parent; now p is for the
exiting child. The condition was to avoid lowering init's priority.
It should be in sched_exit() itself. Lowering of priorities is broken
in other ways in at least the 4BSD scheduler, and doing it for init
causes less noticeable problems than doing it for for shells.
Noticed by: julian (1)
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index ba713e9..5d0f4c3 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -527,13 +527,7 @@ retry: PCPU_SET(switchticks, ticks); cnt.v_swtch++; - - /* - * 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); + sched_exit(p->p_pptr, p); /* * Make sure the scheduler takes this thread out of its tables etc. |