summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_pageout.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-04-17 10:00:55 +0000
committerdg <dg@FreeBSD.org>1995-04-17 10:00:55 +0000
commit421cb9f144fc6315bf6488ed30df32004eaea1a5 (patch)
tree05d5ff3961f720af79b2c3245a44f44f9d164136 /sys/vm/vm_pageout.c
parent8b08997fc4f11e6483ca249cb98109dd08304d24 (diff)
downloadFreeBSD-src-421cb9f144fc6315bf6488ed30df32004eaea1a5.zip
FreeBSD-src-421cb9f144fc6315bf6488ed30df32004eaea1a5.tar.gz
Fixed a logic bug that caused the vmdaemon to not wake up when intended.
Submitted by: John Dyson
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r--sys/vm/vm_pageout.c49
1 files changed, 27 insertions, 22 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index e9bf321..693d1af 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.46 1995/04/16 12:56:22 davidg Exp $
+ * $Id: vm_pageout.c,v 1.47 1995/04/16 14:12:15 davidg Exp $
*/
/*
@@ -526,20 +526,6 @@ vm_pageout_scan()
int force_wakeup = 0;
int vnodes_skipped = 0;
- /* calculate the total cached size */
-
- if ((cnt.v_inactive_count + cnt.v_free_count + cnt.v_cache_count) <
- (cnt.v_inactive_target + cnt.v_free_min)) {
- vm_req_vmdaemon();
- }
- /*
- * now swap processes out if we are in low memory conditions
- */
- if ((cnt.v_free_count <= cnt.v_free_min) &&
- !swap_pager_full && vm_swap_size && vm_pageout_req_swapout == 0) {
- vm_pageout_req_swapout = 1;
- vm_req_vmdaemon();
- }
pages_freed = 0;
/*
@@ -750,16 +736,32 @@ rescan1:
/*
* If we didn't get enough free pages, and we have skipped a vnode
- * in a writeable object, wakeup the sync daemon.
+ * in a writeable object, wakeup the sync daemon. And kick swapout
+ * if we did not get enough free pages.
*/
- if (vnodes_skipped &&
- (cnt.v_cache_count + cnt.v_free_count) < cnt.v_free_min) {
- if (!vfs_update_wakeup) {
- vfs_update_wakeup = 1;
- wakeup((caddr_t) &vfs_update_wakeup);
+ if ((cnt.v_cache_count + cnt.v_free_count) < cnt.v_free_target) {
+ if (vnodes_skipped &&
+ (cnt.v_cache_count + cnt.v_free_count) < cnt.v_free_min) {
+ if (!vfs_update_wakeup) {
+ vfs_update_wakeup = 1;
+ wakeup((caddr_t) &vfs_update_wakeup);
+ }
+ }
+ /*
+ * now swap processes out if we are in low memory conditions
+ */
+ if (!swap_pager_full && vm_swap_size &&
+ vm_pageout_req_swapout == 0) {
+ vm_pageout_req_swapout = 1;
+ vm_req_vmdaemon();
}
}
+ if ((cnt.v_inactive_count + cnt.v_free_count + cnt.v_cache_count) <
+ (cnt.v_inactive_target + cnt.v_free_min)) {
+ vm_req_vmdaemon();
+ }
+
/*
* make sure that we have swap space -- if we are low on memory and
* swap -- then kill the biggest process.
@@ -883,7 +885,10 @@ vm_daemon()
while (TRUE) {
tsleep((caddr_t) &vm_daemon_needed, PUSER, "psleep", 0);
- swapout_threads();
+ if( vm_pageout_req_swapout) {
+ swapout_threads();
+ vm_pageout_req_swapout = 0;
+ }
/*
* scan the processes for exceeding their rlimits or if
* process is swapped out -- deactivate pages
OpenPOWER on IntegriCloud