Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/uvm Pull up revision 1.78 (requested by thorpej in ...
details: https://anonhg.NetBSD.org/src/rev/f9c7ddac7e32
branches: netbsd-1-6
changeset: 529570:f9c7ddac7e32
user: he <he%NetBSD.org@localhost>
date: Sat Nov 30 14:09:06 2002 +0000
description:
Pull up revision 1.78 (requested by thorpej in ticket #759):
When breaking a loan due to a page fault, check to see if
the other kind of reference-holder (anon or object) is
referencing the page. If not, the page must be removed
from the paging queue.
diffstat:
sys/uvm/uvm_fault.c | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diffs (59 lines):
diff -r 58a9371da817 -r f9c7ddac7e32 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c Sat Nov 30 14:07:13 2002 +0000
+++ b/sys/uvm/uvm_fault.c Sat Nov 30 14:09:06 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.76.4.1 2002/11/30 14:07:13 he Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.76.4.2 2002/11/30 14:09:06 he Exp $ */
/*
*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.76.4.1 2002/11/30 14:07:13 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.76.4.2 2002/11/30 14:09:06 he Exp $");
#include "opt_uvmhist.h"
@@ -1091,12 +1091,22 @@
pmap_page_protect(anon->u.an_page,
VM_PROT_NONE);
uvm_lock_pageq(); /* KILL loan */
- if (uobj)
- /* if we were loaning */
- anon->u.an_page->loan_count--;
+
anon->u.an_page->uanon = NULL;
/* in case we owned */
anon->u.an_page->pqflags &= ~PQ_ANON;
+
+ if (uobj) {
+ /* if we were receiver of loan */
+ anon->u.an_page->loan_count--;
+ } else {
+ /*
+ * we were the lender (A->K); need
+ * to remove the page from pageq's.
+ */
+ uvm_pagedequeue(anon->u.an_page);
+ }
+
uvm_pageactivate(pg);
uvm_unlock_pageq();
if (uobj) {
@@ -1486,6 +1496,14 @@
uvm_pagerealloc(uobjpage, NULL, 0);
/*
+ * if the page is no longer referenced by
+ * an anon (i.e. we are breaking an O->K
+ * loan), then remove it from any pageq's.
+ */
+ if (uobjpage->uanon == NULL)
+ uvm_pagedequeue(uobjpage);
+
+ /*
* at this point we have absolutely no
* control over uobjpage
*/
Home |
Main Index |
Thread Index |
Old Index