From 45952afcc7f04421cdf70347c0d2ac2ef1fc90f1 Mon Sep 17 00:00:00 2001 From: John Dyson Date: Wed, 6 Mar 1996 04:31:46 +0000 Subject: [PATCH] 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. --- sys/vm/swap_pager.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index eb42e471a88..8cbf3b82c8f 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); }