Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs wire the pages instead of just dequeue'ing them.



details:   https://anonhg.NetBSD.org/src/rev/05ab95d84a57
branches:  trunk
changeset: 543212:05ab95d84a57
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Feb 19 12:22:51 2003 +0000

description:
wire the pages instead of just dequeue'ing them.
advised by Chuck Silvers.

diffstat:

 sys/ufs/lfs/lfs_vfsops.c |  11 ++++++++---
 sys/ufs/lfs/lfs_vnops.c  |  17 +++++++++--------
 2 files changed, 17 insertions(+), 11 deletions(-)

diffs (87 lines):

diff -r 42f8d8ba852d -r 05ab95d84a57 sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c  Wed Feb 19 12:18:59 2003 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c  Wed Feb 19 12:22:51 2003 +0000
@@ -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 @@
                                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 @@
                        pgs[i]->flags &= ~PG_DELWRI;
                        pgs[i]->flags |= PG_PAGEOUT;
                        uvmexp.paging++;
+                       uvm_lock_pageq();
+                       uvm_pageunwire(pgs[i]);
+                       uvm_unlock_pageq();
                }
 
        /*
diff -r 42f8d8ba852d -r 05ab95d84a57 sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Wed Feb 19 12:18:59 2003 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Wed Feb 19 12:22:51 2003 +0000
@@ -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 @@
                                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) {



Home | Main Index | Thread Index | Old Index