Don't free swap in swap_pager_getpages(): this code probably cause the

"dying daemons" problem. (I thought this code was introduced in rev.1.80,
but it just relaxed the condition.)

Also, kill related "suggest more swap space" warning (also introduced in
1.80). It was confusing, to say the least...

Requested by:		msmith
Not objected by:	dg
This commit is contained in:
Dmitrij Tejblum 1998-12-29 22:53:51 +00:00
parent 9300774d7e
commit 7a91724556
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42153

View File

@ -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.103 1998/10/31 15:31:28 peter Exp $
* $Id: swap_pager.c,v 1.104 1998/11/19 06:20:42 bde Exp $
*/
/*
@ -81,7 +81,6 @@
static int nswiodone;
int swap_pager_full;
extern int vm_swap_size;
static int suggest_more_swap = 0;
static int no_swap_space = 1;
static int max_pageout_cluster;
struct rlisthdr swaplist;
@ -398,11 +397,6 @@ swap_pager_getswapspace(object, amount, rtval)
unsigned location;
vm_swap_size -= amount;
if (!suggest_more_swap && (vm_swap_size < btodb(cnt.v_page_count * PAGE_SIZE))) {
printf("swap_pager: suggest more swap space: %d MB\n",
(2 * cnt.v_page_count * (PAGE_SIZE / 1024)) / 1000);
suggest_more_swap = 1;
}
if (!rlist_alloc(&swaplist, amount, &location)) {
vm_swap_size += amount;
@ -1128,22 +1122,6 @@ swap_pager_getpages(object, m, count, reqpage)
}
m[reqpage]->object->last_read = m[count-1]->pindex;
/*
* If we're out of swap space, then attempt to free
* some whenever multiple pages are brought in. We
* must set the dirty bits so that the page contents
* will be preserved.
*/
if (SWAPLOW ||
(vm_swap_size < btodb((cnt.v_page_count - cnt.v_wire_count)) * PAGE_SIZE)) {
for (i = 0; i < count; i++) {
m[i]->dirty = VM_PAGE_BITS_ALL;
}
swap_pager_freespace(object,
m[0]->pindex + paging_offset, count);
}
} else {
swap_pager_ridpages(m, count, reqpage);
}