diff options
author | dg <dg@FreeBSD.org> | 1994-10-14 01:58:52 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1994-10-14 01:58:52 +0000 |
commit | 449e14aa408f972682e0da34d1409462b0a36f16 (patch) | |
tree | 1bb5f9451f31abfccc64e5d40df2d7ece9fcdf83 | |
parent | 67535793f77fc4dbd724b19b248ced8318f5689f (diff) | |
download | FreeBSD-src-449e14aa408f972682e0da34d1409462b0a36f16.zip FreeBSD-src-449e14aa408f972682e0da34d1409462b0a36f16.tar.gz |
Fixed bug where page modifications would be lost when swap space was
almost depleted.
Reviewed by: John Dyson
-rw-r--r-- | sys/vm/swap_pager.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 4793b6e..6f68fc4 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 - * $Id: swap_pager.c,v 1.10 1994/10/09 01:52:04 phk Exp $ + * $Id: swap_pager.c,v 1.11 1994/10/09 07:35:16 davidg Exp $ */ /* @@ -1162,7 +1162,16 @@ swap_pager_input(swp, m, count, reqpage) PAGE_WAKEUP(m[i]); } } - if( swap_pager_full) { + /* + * If we're out of swap space, then attempt to free + * some whenever pages are brought in. We must clear + * the clean flag so that the page contents will be + * preserved. + */ + if (swap_pager_full) { + for (i = 0; i < count; i++) { + m[i]->flags &= ~PG_CLEAN; + } _swap_pager_freespace( swp, m[0]->offset+paging_offset, count*PAGE_SIZE); } } else { |