summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-02-24 21:26:26 +0000
committerdillon <dillon@FreeBSD.org>1999-02-24 21:26:26 +0000
commit3ad14cacdcabd4212b9384d2ea5ef5eb8a144543 (patch)
tree70e54e7b32beaa82ef4eb4c0d3de4109950694cf /sys/vm
parent7648580bdbf37610588b295d581048815e510c04 (diff)
downloadFreeBSD-src-3ad14cacdcabd4212b9384d2ea5ef5eb8a144543.zip
FreeBSD-src-3ad14cacdcabd4212b9384d2ea5ef5eb8a144543.tar.gz
Remove unnecessary page protects on map_split and collapse operations.
Fix bug where an object's OBJ_WRITEABLE/OBJ_MIGHTBEDIRTY flags do not get set under certain circumstances ( page rename case ). Reviewed by: Alan Cox <alc@cs.rice.edu>, John Dyson
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_map.c6
-rw-r--r--sys/vm/vm_object.c7
-rw-r--r--sys/vm/vm_page.c9
3 files changed, 16 insertions, 6 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index cbb59cf..05c8c5c 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.c,v 1.150 1999/02/19 03:11:37 dillon Exp $
+ * $Id: vm_map.c,v 1.151 1999/02/19 14:25:36 luoqi Exp $
*/
/*
@@ -2162,12 +2162,14 @@ vm_map_split(entry)
/*
* We must wait for pending I/O to complete before we can
* rename the page.
+ *
+ * We do not have to VM_PROT_NONE the page as mappings should
+ * not be changed by this operation.
*/
if (vm_page_sleep_busy(m, TRUE, "spltwt"))
goto retry;
vm_page_busy(m);
- vm_page_protect(m, VM_PROT_NONE);
vm_page_rename(m, new_object, idx);
/* page automatically made dirty by rename and cache handled */
vm_page_busy(m);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 686cf35..ea3b49c 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.150 1999/02/12 20:42:19 dillon Exp $
+ * $Id: vm_object.c,v 1.151 1999/02/15 02:03:40 dillon Exp $
*/
/*
@@ -1086,11 +1086,12 @@ vm_object_backing_scan(vm_object_t object, int op)
/*
* Page does not exist in parent, rename the
* page from the backing object to the main object.
+ *
+ * If the page was mapped to a process, it can remain
+ * mapped through the rename.
*/
if ((p->queue - p->pc) == PQ_CACHE)
vm_page_deactivate(p);
- else
- vm_page_protect(p, VM_PROT_NONE);
vm_page_rename(p, object, new_pindex);
/* page automatically made dirty by rename */
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 7cda5b4..a2e3a83 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
- * $Id: vm_page.c,v 1.125 1999/02/08 00:37:35 dillon Exp $
+ * $Id: vm_page.c,v 1.126 1999/02/15 06:52:14 dillon Exp $
*/
/*
@@ -425,6 +425,13 @@ vm_page_insert(m, object, pindex)
*/
object->resident_page_count++;
+
+ /*
+ * Since we are inserting a new and possibly dirty page,
+ * update the object's OBJ_WRITEABLE and OBJ_MIGHTBEDIRTY flags.
+ */
+ if (m->flags & PG_WRITEABLE)
+ vm_object_set_flag(object, OBJ_WRITEABLE|OBJ_MIGHTBEDIRTY);
}
/*
OpenPOWER on IntegriCloud