Source-Changes-HG archive

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

[src/trunk]: src/sys make sure that pages are on an paging queue before unloc...



details:   https://anonhg.NetBSD.org/src/rev/c4ebe15c5701
branches:  trunk
changeset: 499884:c4ebe15c5701
user:      chs <chs%NetBSD.org@localhost>
date:      Fri Dec 01 09:54:42 2000 +0000

description:
make sure that pages are on an paging queue before unlocking them.

diffstat:

 sys/ufs/ufs/ufs_inode.c |  12 +++++++++++-
 sys/uvm/uvm_page.c      |   4 +++-
 sys/uvm/uvm_pager.c     |   5 ++++-
 3 files changed, 18 insertions(+), 3 deletions(-)

diffs (80 lines):

diff -r 91227d5203da -r c4ebe15c5701 sys/ufs/ufs/ufs_inode.c
--- a/sys/ufs/ufs/ufs_inode.c   Fri Dec 01 09:52:33 2000 +0000
+++ b/sys/ufs/ufs/ufs_inode.c   Fri Dec 01 09:54:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_inode.c,v 1.16 2000/11/27 08:39:57 chs Exp $       */
+/*     $NetBSD: ufs_inode.c,v 1.17 2000/12/01 09:54:42 chs Exp $       */
 
 /*
  * Copyright (c) 1991, 1993
@@ -209,11 +209,16 @@
                if (error) {
                        goto out;
                }
+               simple_lock(&uobj->vmobjlock);
+               uvm_lock_pageq();
                for (i = 0; i < npages1; i++) {
                        UVMHIST_LOG(ubchist, "got pgs1[%d] %p", i, pgs1[i],0,0);
                        KASSERT((pgs1[i]->flags & PG_RELEASED) == 0);
                        pgs1[i]->flags &= ~PG_CLEAN;
+                       uvm_pageactivate(pgs1[i]);
                }
+               uvm_unlock_pageq();
+               simple_unlock(&uobj->vmobjlock);
        }
 
        /*
@@ -234,11 +239,16 @@
                if (error) {
                        goto out;
                }
+               simple_lock(&uobj->vmobjlock);
+               uvm_lock_pageq();
                for (i = 0; i < npages2; i++) {
                        UVMHIST_LOG(ubchist, "got pgs2[%d] %p", i, pgs2[i],0,0);
                        KASSERT((pgs2[i]->flags & PG_RELEASED) == 0);
                        pgs2[i]->flags &= ~PG_CLEAN;
+                       uvm_pageactivate(pgs2[i]);
                }
+               uvm_unlock_pageq();
+               simple_unlock(&uobj->vmobjlock);
        }
 
        /*
diff -r 91227d5203da -r c4ebe15c5701 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Fri Dec 01 09:52:33 2000 +0000
+++ b/sys/uvm/uvm_page.c        Fri Dec 01 09:54:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.45 2000/11/30 11:04:44 simonb Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.46 2000/12/01 09:54:42 chs Exp $        */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -1230,6 +1230,8 @@
                        }
                } else {
                        UVMHIST_LOG(ubchist, "unbusying pg %p", pg,0,0,0);
+                       KASSERT(pg->wire_count ||
+                               (pg->pqflags & (PQ_ACTIVE|PQ_INACTIVE)));
                        pg->flags &= ~(PG_WANTED|PG_BUSY);
                        UVM_PAGE_OWN(pg, NULL);
                }
diff -r 91227d5203da -r c4ebe15c5701 sys/uvm/uvm_pager.c
--- a/sys/uvm/uvm_pager.c       Fri Dec 01 09:52:33 2000 +0000
+++ b/sys/uvm/uvm_pager.c       Fri Dec 01 09:54:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pager.c,v 1.36 2000/11/27 18:26:41 chs Exp $       */
+/*     $NetBSD: uvm_pager.c,v 1.37 2000/12/01 09:54:42 chs Exp $       */
 
 /*
  *
@@ -859,6 +859,9 @@
                        pgs[i]->flags |= PG_CLEAN;
                        pgs[i]->flags &= ~PG_FAKE;
                }
+               if (pg->wire_count == 0) {
+                       uvm_pageactivate(pg);
+               }
                if (swap) {
                        if (pg->pqflags & PQ_ANON) {
                                simple_unlock(&pg->uanon->an_lock);



Home | Main Index | Thread Index | Old Index