summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-11-03 03:40:47 +0000
committerdyson <dyson@FreeBSD.org>1996-11-03 03:40:47 +0000
commitbdd16196de0792c0eb0427f0568fe5327a656d9b (patch)
tree34f5632c635f4c9b27fdd3b4f5856d971048ce30 /sys
parent01addb2f214a309e6c43ef36e4dc052842d02191 (diff)
downloadFreeBSD-src-bdd16196de0792c0eb0427f0568fe5327a656d9b.zip
FreeBSD-src-bdd16196de0792c0eb0427f0568fe5327a656d9b.tar.gz
Fix a problem with running down processes that have left wired
mappings with mlock. This problem only occurred because of the quick unmap code not respecting the wired-ness of pages in the process. In the future, we need to eliminate the dependency intrinsic to the design of the code that wired pages actually be mapped. It is kind-of bogus not to have wired pages mapped, but it is also a weakness for the code to fall flat because of a missing page. This show fix a problem that Tor Egge has been having, and also should be included into 2.2-RELEASE.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/pmap.c13
-rw-r--r--sys/i386/i386/pmap.c13
2 files changed, 20 insertions, 6 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 510168e..23de085 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.127 1996/10/15 03:16:31 dyson Exp $
+ * $Id: pmap.c,v 1.128 1996/10/23 05:31:54 dyson Exp $
*/
/*
@@ -2571,13 +2571,20 @@ pmap_remove_pages(pmap, sva, eva)
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
#endif
tpte = *pte;
+
+/*
+ * We cannot remove wired pages from a process' mapping at this time
+ */
+ if (tpte & PG_W) {
+ npv = TAILQ_NEXT(pv, pv_plist);
+ continue;
+ }
*pte = 0;
ppv = pa_to_pvh(tpte);
pv->pv_pmap->pm_stats.resident_count--;
- if (tpte & PG_W)
- pv->pv_pmap->pm_stats.wired_count--;
+
/*
* Update the vm_page_t clean and reference bits.
*/
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 510168e..23de085 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $Id: pmap.c,v 1.127 1996/10/15 03:16:31 dyson Exp $
+ * $Id: pmap.c,v 1.128 1996/10/23 05:31:54 dyson Exp $
*/
/*
@@ -2571,13 +2571,20 @@ pmap_remove_pages(pmap, sva, eva)
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
#endif
tpte = *pte;
+
+/*
+ * We cannot remove wired pages from a process' mapping at this time
+ */
+ if (tpte & PG_W) {
+ npv = TAILQ_NEXT(pv, pv_plist);
+ continue;
+ }
*pte = 0;
ppv = pa_to_pvh(tpte);
pv->pv_pmap->pm_stats.resident_count--;
- if (tpte & PG_W)
- pv->pv_pmap->pm_stats.wired_count--;
+
/*
* Update the vm_page_t clean and reference bits.
*/
OpenPOWER on IntegriCloud