diff options
author | dg <dg@FreeBSD.org> | 1996-02-22 10:57:37 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1996-02-22 10:57:37 +0000 |
commit | f54e4705e69eea4684321d09a2a8c4fab628b5ce (patch) | |
tree | 417e29a08626b6c8041f78bb5ff3065d5927f43b /sys/vm/vm_pageout.c | |
parent | 60f52cc4c159387974b7ca89b671e47d3f44ef62 (diff) | |
download | FreeBSD-src-f54e4705e69eea4684321d09a2a8c4fab628b5ce.zip FreeBSD-src-f54e4705e69eea4684321d09a2a8c4fab628b5ce.tar.gz |
Add a "NO_SWAPPING" option to disable swapping. This was originally done
to help diagnose a problem on wcarchive (where the kernel stack was
sometimes not present), but is useful in its own right since swapping
actually reduces performance on some systems (such as wcarchive).
Note: swapping in this context means making the U pages pageable and has
nothing to do with generic VM paging, which is unaffected by this option.
Reviewed by: <dyson>
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r-- | sys/vm/vm_pageout.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 3ba895c..7e92337 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -65,7 +65,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pageout.c,v 1.64 1996/01/19 04:00:23 dyson Exp $ + * $Id: vm_pageout.c,v 1.65 1996/01/31 12:44:33 davidg Exp $ */ /* @@ -113,6 +113,7 @@ static struct kproc_desc page_kp = { }; SYSINIT_KT(pagedaemon, SI_SUB_KTHREAD_PAGE, SI_ORDER_FIRST, kproc_start, &page_kp) +#ifndef NO_SWAPPING /* the kernel process "vm_daemon"*/ static void vm_daemon __P((void)); static struct proc *vmproc; @@ -123,6 +124,7 @@ static struct kproc_desc vm_kp = { &vmproc }; SYSINIT_KT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp) +#endif /* !NO_SWAPPING */ int vm_pages_needed; /* Event on which pageout daemon sleeps */ @@ -527,17 +529,6 @@ vm_pageout_map_deactivate_pages(map, entry, count, freeer) return; } -static void -vm_req_vmdaemon() -{ - static int lastrun = 0; - - if ((ticks > (lastrun + hz / 10)) || (ticks < lastrun)) { - wakeup(&vm_daemon_needed); - lastrun = ticks; - } -} - /* * vm_pageout_scan does the dirty work for the pageout daemon. */ @@ -776,6 +767,7 @@ rescan1: wakeup(&vfs_update_wakeup); } } +#ifndef NO_SWAPPING /* * now swap processes out if we are in low memory conditions */ @@ -784,12 +776,15 @@ rescan1: vm_pageout_req_swapout = 1; vm_req_vmdaemon(); } +#endif } +#ifndef NO_SWAPPING if ((cnt.v_inactive_count + cnt.v_free_count + cnt.v_cache_count) < (cnt.v_inactive_target + cnt.v_free_min)) { vm_req_vmdaemon(); } +#endif /* * make sure that we have swap space -- if we are low on memory and @@ -905,6 +900,18 @@ vm_pageout() } } +#ifndef NO_SWAPPING +static void +vm_req_vmdaemon() +{ + static int lastrun = 0; + + if ((ticks > (lastrun + hz / 10)) || (ticks < lastrun)) { + wakeup(&vm_daemon_needed); + lastrun = ticks; + } +} + static void vm_daemon() { @@ -981,3 +988,4 @@ restart: } } } +#endif /* !NO_SWAPPING */ |