Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/uvm Pull up revision 1.98 (requested by yamt in tic...



details:   https://anonhg.NetBSD.org/src/rev/9002259aba00
branches:  netbsd-2-0
changeset: 560805:9002259aba00
user:      tron <tron%NetBSD.org@localhost>
date:      Mon May 10 14:30:22 2004 +0000

description:
Pull up revision 1.98 (requested by yamt in ticket #271):
uvm_page_unbusy: add assertions and comments about PG_RELEASED anon pages.

diffstat:

 sys/uvm/uvm_page.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r e085309ac8a8 -r 9002259aba00 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Mon May 10 14:28:57 2004 +0000
+++ b/sys/uvm/uvm_page.c        Mon May 10 14:30:22 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.97 2004/03/24 07:50:49 junyoung Exp $   */
+/*     $NetBSD: uvm_page.c,v 1.97.2.1 2004/05/10 14:30:22 tron Exp $   */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.97 2004/03/24 07:50:49 junyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.97.2.1 2004/05/10 14:30:22 tron Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -1443,6 +1443,7 @@
  * => if pages are object-owned, object must be locked.
  * => if pages are anon-owned, anons must be locked.
  * => caller must lock page queues if pages may be released.
+ * => caller must make sure that anon-owned pages are not PG_RELEASED.
  */
 
 void
@@ -1459,11 +1460,22 @@
                if (pg == NULL || pg == PGO_DONTCARE) {
                        continue;
                }
+
+               LOCK_ASSERT(pg->uobject == NULL ||
+                   simple_lock_held(&pg->uobject->vmobjlock));
+               LOCK_ASSERT(pg->uobject != NULL ||
+                   (pg->uanon != NULL &&
+                   simple_lock_held(&pg->uanon->an_lock)));
+
+               KASSERT(pg->flags & PG_BUSY);
+               KASSERT((pg->flags & PG_PAGEOUT) == 0);
                if (pg->flags & PG_WANTED) {
                        wakeup(pg);
                }
                if (pg->flags & PG_RELEASED) {
                        UVMHIST_LOG(ubchist, "releasing pg %p", pg,0,0,0);
+                       KASSERT(pg->uobject != NULL ||
+                           (pg->uanon != NULL && pg->uanon->an_ref > 0));
                        pg->flags &= ~PG_RELEASED;
                        uvm_pagefree(pg);
                } else {



Home | Main Index | Thread Index | Old Index