diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2024-12-27 12:04:41 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2024-12-27 12:04:41 +0000 |
commit | 35c9f4e7491175ed61e669eb7d7aa427fbad8eb4 (patch) | |
tree | 41ee809e16544749a363fb8ae78020c9abaecc76 | |
parent | a3fb053665fd92953f7ec9ef45c4ac78d0e4ed80 (diff) |
Move pmap_page_protect(PROT_NONE) call inside uvm_pagedeactivate().
ok tb@, kettenis@
-rw-r--r-- | sys/uvm/uvm_anon.c | 3 | ||||
-rw-r--r-- | sys/uvm/uvm_aobj.c | 3 | ||||
-rw-r--r-- | sys/uvm/uvm_fault.c | 3 | ||||
-rw-r--r-- | sys/uvm/uvm_map.c | 7 | ||||
-rw-r--r-- | sys/uvm/uvm_page.c | 6 | ||||
-rw-r--r-- | sys/uvm/uvm_pdaemon.c | 3 | ||||
-rw-r--r-- | sys/uvm/uvm_vnode.c | 4 |
7 files changed, 10 insertions, 19 deletions
diff --git a/sys/uvm/uvm_anon.c b/sys/uvm/uvm_anon.c index 42b8b438a32..8af04a344bf 100644 --- a/sys/uvm/uvm_anon.c +++ b/sys/uvm/uvm_anon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_anon.c,v 1.60 2024/12/24 08:39:30 mpi Exp $ */ +/* $OpenBSD: uvm_anon.c,v 1.61 2024/12/27 12:04:40 mpi Exp $ */ /* $NetBSD: uvm_anon.c,v 1.10 2000/11/25 06:27:59 chs Exp $ */ /* @@ -202,7 +202,6 @@ uvm_anon_pagein(struct vm_amap *amap, struct vm_anon *anon) /* * Deactivate the page (to put it on a page queue). */ - pmap_page_protect(pg, 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 fb65e33ff11..01069f44f08 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_aobj.c,v 1.114 2024/12/24 08:39:30 mpi Exp $ */ +/* $OpenBSD: uvm_aobj.c,v 1.115 2024/12/27 12:04:40 mpi Exp $ */ /* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */ /* @@ -930,7 +930,6 @@ uao_flush(struct uvm_object *uobj, voff_t start, voff_t stop, int flags) continue; uvm_lock_pageq(); - pmap_page_protect(pg, PROT_NONE); uvm_pagedeactivate(pg); uvm_unlock_pageq(); diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c index b4fd26e61f0..17a871c8792 100644 --- a/sys/uvm/uvm_fault.c +++ b/sys/uvm/uvm_fault.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_fault.c,v 1.157 2024/12/24 08:55:48 mpi Exp $ */ +/* $OpenBSD: uvm_fault.c,v 1.158 2024/12/27 12:04:40 mpi Exp $ */ /* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */ /* @@ -185,7 +185,6 @@ uvmfault_anonflush(struct vm_anon **anons, int n) if (pg && (pg->pg_flags & PG_BUSY) == 0) { uvm_lock_pageq(); if (pg->wire_count == 0) { - pmap_page_protect(pg, PROT_NONE); uvm_pagedeactivate(pg); } uvm_unlock_pageq(); diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 8ecdc5d06e6..418593cee87 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.336 2024/12/11 02:00:32 dlg Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.337 2024/12/27 12:04:40 mpi Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -4524,11 +4524,6 @@ deactivate_it: uvm_lock_pageq(); KASSERT(pg->uanon == anon); - - /* zap all mappings for the page. */ - pmap_page_protect(pg, PROT_NONE); - - /* ...and deactivate the page. */ uvm_pagedeactivate(pg); uvm_unlock_pageq(); diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 3c3ea33c36e..d51639c9ea2 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.179 2024/12/20 18:54:12 mpi Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.180 2024/12/27 12:04:40 mpi Exp $ */ /* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */ /* @@ -1256,7 +1256,7 @@ uvm_pageunwire(struct vm_page *pg) } /* - * uvm_pagedeactivate: deactivate page -- no pmaps have access to page + * uvm_pagedeactivate: deactivate page. * * => caller must lock page queues * => caller must check to make sure page is not wired @@ -1268,6 +1268,8 @@ uvm_pagedeactivate(struct vm_page *pg) KASSERT(uvm_page_owner_locked_p(pg, FALSE)); MUTEX_ASSERT_LOCKED(&uvm.pageqlock); + pmap_page_protect(pg, 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_pdaemon.c b/sys/uvm/uvm_pdaemon.c index 4e5228e7be3..74aaf7f942f 100644 --- a/sys/uvm/uvm_pdaemon.c +++ b/sys/uvm/uvm_pdaemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pdaemon.c,v 1.132 2024/11/25 13:37:49 mpi Exp $ */ +/* $OpenBSD: uvm_pdaemon.c,v 1.133 2024/12/27 12:04:40 mpi Exp $ */ /* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */ /* @@ -1020,7 +1020,6 @@ uvmpd_scan_active(struct uvm_pmalloc *pma, int swap_shortage, * inactive pages. */ if (inactive_shortage > 0) { - pmap_page_protect(p, PROT_NONE); /* no need to check wire_count as pg is "active" */ uvm_pagedeactivate(p); uvmexp.pddeact++; diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c index e1b6e4c1256..6484a797957 100644 --- a/sys/uvm/uvm_vnode.c +++ b/sys/uvm/uvm_vnode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_vnode.c,v 1.137 2024/12/20 18:49:37 mpi Exp $ */ +/* $OpenBSD: uvm_vnode.c,v 1.138 2024/12/27 12:04:40 mpi Exp $ */ /* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */ /* @@ -683,7 +683,6 @@ uvn_flush(struct uvm_object *uobj, voff_t start, voff_t stop, int flags) if (!needs_clean) { if (flags & PGO_DEACTIVATE) { if (pp->wire_count == 0) { - pmap_page_protect(pp, PROT_NONE); uvm_pagedeactivate(pp); } } else if (flags & PGO_FREE) { @@ -809,7 +808,6 @@ ReTry: /* dispose of page */ if (flags & PGO_DEACTIVATE) { if (ptmp->wire_count == 0) { - pmap_page_protect(ptmp, PROT_NONE); uvm_pagedeactivate(ptmp); } } else if (flags & PGO_FREE && |