From d022b5caad2e2a658a80d3fa350acba1c21cbbec Mon Sep 17 00:00:00 2001 From: pk Date: Mon, 11 Aug 2003 16:54:10 +0000 Subject: [PATCH] uao_pagein_page() & anon_pagein(): * return failure if the page cannot be retrieved. * wakeup any waiters when releasing a page after successful page in. --- sys/uvm/uvm_anon.c | 12 ++++++++++-- sys/uvm/uvm_aobj.c | 12 +++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/sys/uvm/uvm_anon.c b/sys/uvm/uvm_anon.c index e060d8e4a9ee..923284513947 100644 --- a/sys/uvm/uvm_anon.c +++ b/sys/uvm/uvm_anon.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_anon.c,v 1.24 2003/08/11 16:48:05 pk Exp $ */ +/* $NetBSD: uvm_anon.c,v 1.25 2003/08/11 16:54:10 pk Exp $ */ /* * @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.24 2003/08/11 16:48:05 pk Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.25 2003/08/11 16:54:10 pk Exp $"); #include "opt_uvmhist.h" @@ -501,6 +501,9 @@ anon_pagein(anon) */ return FALSE; + + default: + return TRUE; } /* @@ -525,6 +528,11 @@ anon_pagein(anon) uvm_pagedeactivate(pg); uvm_unlock_pageq(); + if (pg->flags & PG_WANTED) { + wakeup(pg); + pg->flags &= ~(PG_WANTED); + } + /* * unlock the anon and we're done. */ diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c index 924fc1e9121b..e906d7d0bdfa 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_aobj.c,v 1.58 2003/08/11 16:48:05 pk Exp $ */ +/* $NetBSD: uvm_aobj.c,v 1.59 2003/08/11 16:54:11 pk Exp $ */ /* * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.58 2003/08/11 16:48:05 pk Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.59 2003/08/11 16:54:11 pk Exp $"); #include "opt_uvmhist.h" @@ -1452,6 +1452,9 @@ uao_pagein_page(aobj, pageidx) */ return FALSE; + + default: + return TRUE; } /* @@ -1468,7 +1471,10 @@ uao_pagein_page(aobj, pageidx) uvm_pagedeactivate(pg); uvm_unlock_pageq(); - pg->flags &= ~(PG_BUSY|PG_CLEAN|PG_FAKE); + if (pg->flags & PG_WANTED) { + wakeup(pg); + } + pg->flags &= ~(PG_WANTED|PG_BUSY|PG_CLEAN|PG_FAKE); UVM_PAGE_OWN(pg, NULL); return FALSE;