diff options
author | avg <avg@FreeBSD.org> | 2013-07-24 09:45:31 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2013-07-24 09:45:31 +0000 |
commit | 9e6374b6a9ee35bc4eb4e1d73c4942b4b2391e57 (patch) | |
tree | 86485591661a4e2aaffdc78caab463f4b4f101f9 /sys/vm/vm_glue.c | |
parent | 0a4136d3530f88ddcec3af09ad403f557fba393b (diff) | |
download | FreeBSD-src-9e6374b6a9ee35bc4eb4e1d73c4942b4b2391e57.zip FreeBSD-src-9e6374b6a9ee35bc4eb4e1d73c4942b4b2391e57.tar.gz |
rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST
Also directly call swapper() at the end of mi_startup instead of
relying on swapper being the last thing in sysinits order.
Rationale:
- "RUN_SCHEDULER" was misleading, scheduling already takes place at that stage
- "scheduler" was misleading, the function swaps in the swapped out processes
- another SYSINIT(SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY) could never be
invoked depending on its relative order with scheduler; this was not obvious
and the bug actually used to exist
Reviewed by: kib (ealier version)
MFC after: 14 days
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r-- | sys/vm/vm_glue.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 6183518..948e2b3 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -96,16 +96,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_pager.h> #include <vm/swap_pager.h> -/* - * System initialization - * - * THIS MUST BE THE LAST INITIALIZATION ITEM!!! - * - * Note: run scheduling should be divorced from the vm system. - */ -static void scheduler(void *); -SYSINIT(scheduler, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, scheduler, NULL); - #ifndef NO_SWAPPING static int swapout(struct proc *); static void swapclear(struct proc *); @@ -695,10 +685,8 @@ faultin(p) * * Giant is held on entry. */ -/* ARGSUSED*/ -static void -scheduler(dummy) - void *dummy; +void +swapper(void) { struct proc *p; struct thread *td; @@ -708,9 +696,6 @@ scheduler(dummy) int ppri; int pri; - mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED); - mtx_unlock(&Giant); - loop: if (vm_page_count_min()) { VM_WAIT; @@ -761,7 +746,7 @@ loop: * Nothing to do, back to sleep. */ if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "sched", MAXSLP * hz / 2); + tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); goto loop; } PROC_LOCK(p); |