summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-03-06 04:31:46 +0000
committerdyson <dyson@FreeBSD.org>1996-03-06 04:31:46 +0000
commit51a9444d94846a0481ed4927b76b256b051fcb16 (patch)
tree6ac2f49dce9d5af13509575b4ee6d2be6539960b
parentf4d1562bc5f69802916a989684b30c5a19da3df0 (diff)
downloadFreeBSD-src-51a9444d94846a0481ed4927b76b256b051fcb16.zip
FreeBSD-src-51a9444d94846a0481ed4927b76b256b051fcb16.tar.gz
Fix a problem in the swap pager that caused some of the pages that
were paged in under low swap space conditions to both loose their backing store and their dirty bits. This would cause pages to be demand zeroed under certain conditions in low VM space conditions and consequential sig-11's or sig-10's. This situation was made worse lately when the level for swap space reclaim threshold was increased.
-rw-r--r--sys/vm/swap_pager.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index eb42e47..8cbf3b8 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.61 1996/03/02 02:54:17 dyson Exp $
+ * $Id: swap_pager.c,v 1.62 1996/03/03 21:11:05 dyson Exp $
*/
/*
@@ -1045,6 +1045,11 @@ swap_pager_getpages(object, m, count, reqpage)
if (swap_pager_needflags & SWAP_FREE_NEEDED_BY_PAGEOUT)
pagedaemon_wakeup();
swap_pager_needflags &= ~(SWAP_FREE_NEEDED|SWAP_FREE_NEEDED_BY_PAGEOUT);
+ if (rv == VM_PAGER_OK) {
+ pmap_clear_modify(VM_PAGE_TO_PHYS(m[reqpage]));
+ m[reqpage]->valid = VM_PAGE_BITS_ALL;
+ m[reqpage]->dirty = 0;
+ }
} else {
/*
* release the physical I/O buffer
@@ -1084,9 +1089,9 @@ swap_pager_getpages(object, m, count, reqpage)
/*
* 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.
+ * some whenever multiple pages are brought in. We
+ * must set the dirty bits so that the page contents
+ * will be preserved.
*/
if (SWAPLOW) {
for (i = 0; i < count; i++) {
@@ -1098,11 +1103,6 @@ swap_pager_getpages(object, m, count, reqpage)
swap_pager_ridpages(m, count, reqpage);
}
}
- if (rv == VM_PAGER_OK) {
- pmap_clear_modify(VM_PAGE_TO_PHYS(m[reqpage]));
- m[reqpage]->valid = VM_PAGE_BITS_ALL;
- m[reqpage]->dirty = 0;
- }
return (rv);
}
OpenPOWER on IntegriCloud