summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2009-06-06 17:46:45 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2009-06-06 17:46:45 +0000
commite4d12862f7f76c8ed57d8579930e566bce6a2228 (patch)
tree6a9bbe4cfc4cb5308b9057ef50e02783db8835e5 /sys/uvm
parente6e2df708cbe8eb2e54204b7234a3d338d16471c (diff)
Since all callers of uvm_pagedeactivate did pmap_page_protect(.., VM_PROT_NONE)
just move that into uvm_pagedeactivate. oga@ ok
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_anon.c3
-rw-r--r--sys/uvm/uvm_aobj.c9
-rw-r--r--sys/uvm/uvm_fault.c7
-rw-r--r--sys/uvm/uvm_map.c12
-rw-r--r--sys/uvm/uvm_page.c4
-rw-r--r--sys/uvm/uvm_vnode.c4
6 files changed, 10 insertions, 29 deletions
diff --git a/sys/uvm/uvm_anon.c b/sys/uvm/uvm_anon.c
index c801de3d7f1..4c75237f5c8 100644
--- a/sys/uvm/uvm_anon.c
+++ b/sys/uvm/uvm_anon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_anon.c,v 1.31 2009/05/30 18:58:03 oga Exp $ */
+/* $OpenBSD: uvm_anon.c,v 1.32 2009/06/06 17:46:44 art Exp $ */
/* $NetBSD: uvm_anon.c,v 1.10 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -354,7 +354,6 @@ uvm_anon_pagein(struct vm_anon *anon)
*/
pmap_clear_reference(pg);
- pmap_page_protect(pg, VM_PROT_NONE);
uvm_lock_pageq();
uvm_pagedeactivate(pg);
uvm_unlock_pageq();
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index 9726d616819..b651338c28a 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_aobj.c,v 1.41 2009/06/02 23:00:19 oga Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.42 2009/06/06 17:46:44 art Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -790,10 +790,8 @@ uao_flush(struct uvm_object *uobj, voff_t start, voff_t stop, int flags)
continue;
uvm_lock_pageq();
- /* zap all mappings for the page. */
- pmap_page_protect(pp, VM_PROT_NONE);
- /* ...and deactivate the page. */
+ /* Deactivate the page. */
uvm_pagedeactivate(pp);
uvm_unlock_pageq();
@@ -1352,9 +1350,6 @@ uao_pagein_page(struct uvm_aobj *aobj, int pageidx)
* deactivate the page (to put it on a page queue).
*/
pmap_clear_reference(pg);
-#ifndef UBC
- pmap_page_protect(pg, VM_PROT_NONE);
-#endif
uvm_lock_pageq();
uvm_pagedeactivate(pg);
uvm_unlock_pageq();
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c
index e9b26c9f9bc..e0e8946c49c 100644
--- a/sys/uvm/uvm_fault.c
+++ b/sys/uvm/uvm_fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_fault.c,v 1.54 2009/06/01 19:54:02 oga Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.55 2009/06/06 17:46:44 art Exp $ */
/* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */
/*
@@ -203,11 +203,6 @@ uvmfault_anonflush(struct vm_anon **anons, int n)
if (pg && (pg->pg_flags & PG_BUSY) == 0 && pg->loan_count == 0) {
uvm_lock_pageq();
if (pg->wire_count == 0) {
-#ifdef UBC
- pmap_clear_reference(pg);
-#else
- pmap_page_protect(pg, VM_PROT_NONE);
-#endif
uvm_pagedeactivate(pg);
}
uvm_unlock_pageq();
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 13ff91d9c72..70e60fd2b56 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.112 2009/06/02 23:00:19 oga Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.113 2009/06/06 17:46:44 art Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -3058,15 +3058,7 @@ uvm_map_clean(struct vm_map *map, vaddr_t start, vaddr_t end, int flags)
}
KASSERT(pg->uanon == anon);
-#ifdef UBC
- /* ...and deactivate the page. */
- pmap_clear_reference(pg);
-#else
- /* zap all mappings for the page. */
- pmap_page_protect(pg, VM_PROT_NONE);
-
- /* ...and deactivate the page. */
-#endif
+ /* Deactivate the page. */
uvm_pagedeactivate(pg);
uvm_unlock_pageq();
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index 66a34526725..81a43beef22 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page.c,v 1.85 2009/06/03 04:56:54 ariane Exp $ */
+/* $OpenBSD: uvm_page.c,v 1.86 2009/06/06 17:46:44 art Exp $ */
/* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */
/*
@@ -1344,6 +1344,8 @@ uvm_pageunwire(struct vm_page *pg)
void
uvm_pagedeactivate(struct vm_page *pg)
{
+ pmap_page_protect(pg, VM_PROT_NONE);
+
if (pg->pg_flags & PQ_ACTIVE) {
TAILQ_REMOVE(&uvm.page_active, pg, pageq);
atomic_clearbits_int(&pg->pg_flags, PQ_ACTIVE);
diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c
index 6ea52aed027..c15ebbf70a0 100644
--- a/sys/uvm/uvm_vnode.c
+++ b/sys/uvm/uvm_vnode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_vnode.c,v 1.61 2009/06/02 23:00:19 oga Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.62 2009/06/06 17:46:44 art Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */
/*
@@ -802,7 +802,6 @@ uvn_flush(struct uvm_object *uobj, voff_t start, voff_t stop, int flags)
if (flags & PGO_DEACTIVATE) {
if ((pp->pg_flags & PQ_INACTIVE) == 0 &&
pp->wire_count == 0) {
- pmap_page_protect(pp, VM_PROT_NONE);
uvm_pagedeactivate(pp);
}
} else if (flags & PGO_FREE) {
@@ -946,7 +945,6 @@ ReTry:
if (flags & PGO_DEACTIVATE) {
if ((pp->pg_flags & PQ_INACTIVE) == 0 &&
pp->wire_count == 0) {
- pmap_page_protect(ptmp, VM_PROT_NONE);
uvm_pagedeactivate(ptmp);
}
} else if (flags & PGO_FREE &&