wire the pages instead of just dequeue'ing them.

advised by Chuck Silvers.
This commit is contained in:
yamt 2003-02-19 12:22:51 +00:00
parent 18e00c1196
commit d9a4f81d1c
2 changed files with 17 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_vfsops.c,v 1.93 2003/02/19 12:18:59 yamt Exp $ */
/* $NetBSD: lfs_vfsops.c,v 1.94 2003/02/19 12:22:51 yamt Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.93 2003/02/19 12:18:59 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.94 2003/02/19 12:22:51 yamt Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -1804,9 +1804,11 @@ lfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
wakeup(pgs[i]);
if (pgs[i]->flags & PG_PAGEOUT)
uvmexp.paging--;
if (pgs[i]->flags & PG_DELWRI) {
uvm_pageunwire(pgs[i]);
}
pgs[i]->flags &= ~(PG_BUSY|PG_CLEAN|PG_WANTED|PG_DELWRI|PG_PAGEOUT|PG_RELEASED);
UVM_PAGE_OWN(pg, NULL);
uvm_pageactivate(pgs[i]);
}
uvm_page_unbusy(pgs, npages);
uvm_unlock_pageq();
@ -1841,6 +1843,9 @@ lfs_gop_write(struct vnode *vp, struct vm_page **pgs, int npages, int flags)
pgs[i]->flags &= ~PG_DELWRI;
pgs[i]->flags |= PG_PAGEOUT;
uvmexp.paging++;
uvm_lock_pageq();
uvm_pageunwire(pgs[i]);
uvm_unlock_pageq();
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_vnops.c,v 1.84 2003/02/17 23:48:22 perseant Exp $ */
/* $NetBSD: lfs_vnops.c,v 1.85 2003/02/19 12:22:51 yamt Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.84 2003/02/17 23:48:22 perseant Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.85 2003/02/19 12:22:51 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1146,20 +1146,21 @@ check_dirty(struct lfs *fs, struct vnode *vp,
if (flags & PGO_FREE) {
/* XXXUBC need better way to update */
lfs_subsys_pages += MIN(1, pages_per_block);
/*
* wire the page so that
* pdaemon don't see it again.
*/
uvm_lock_pageq();
UVM_PAGE_OWN(pg, NULL);
uvm_pagedequeue(pg);
uvm_pagewire(pg);
uvm_unlock_pageq();
/* Suspended write flag */
pg->flags |= PG_DELWRI;
uvm_unlock_pageq();
}
} else {
UVM_PAGE_OWN(pg, NULL);
}
if (pg->flags & PG_WANTED)
wakeup(pg);
pg->flags &= ~(PG_WANTED|PG_BUSY);
/* UVM_PAGE_OWN(pg, NULL); */
UVM_PAGE_OWN(pg, NULL);
}
if (by_list) {