summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2004-01-29 12:35:11 +0000
committerbde <bde@FreeBSD.org>2004-01-29 12:35:11 +0000
commit708713d12b9abb7ddc0eca2e108944336ff49028 (patch)
tree940788f117e339b680110c1e76d2f2bb235e3f18 /sys/vm
parent31275ad8daf7ea3cb64999532ccd645cda8248c3 (diff)
downloadFreeBSD-src-708713d12b9abb7ddc0eca2e108944336ff49028.zip
FreeBSD-src-708713d12b9abb7ddc0eca2e108944336ff49028.tar.gz
Fixed breakage of scheduling in rev.1.29 of subr_4bsd.c. The
"scheduler" here has very little to do with scheduling. It is actually the swapper, and it really must be the last SYSINIT'ed item like its comment says, since proc0 metamorphoses into swapper by calling scheduler() last in mi_start(), and scheduler() never returns.. Rev.1.29 of subr_4bsd.c broke this by adding another SI_ORDER_FIRST item (kproc_start() for schedcpu_thread() onto the SI_SUB_RUN_SCHEDULER_LIST. The sorting of SYSINITs with identical orders (at all levels) is apparently nondeterministic, so this resulted in schedule() sometimes being called second last and schedcpu_thread() not being called at all. This quick fix just changes the code to almost match the comment (SI_ORDER_FIRST -> SI_ORDER_ANY). "LAST" is misspelled "ANY", and there is no way to ensure that there is only 1 very lst SYSINIT. A more complete fix would remove the SYSINIT obfuscation.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_glue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 2dda5f8..6fe4405 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -113,7 +113,7 @@ SYSINIT(vm_limits, SI_SUB_VM_CONF, SI_ORDER_FIRST, vm_init_limits, &proc0)
* Note: run scheduling should be divorced from the vm system.
*/
static void scheduler(void *);
-SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_FIRST, scheduler, NULL)
+SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, scheduler, NULL)
#ifndef NO_SWAPPING
static void swapout(struct proc *);
OpenPOWER on IntegriCloud