summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-03-22 12:24:11 +0000
committerdg <dg@FreeBSD.org>1995-03-22 12:24:11 +0000
commit4aa815202930e674583ec1ac86cfe5f12f0238f7 (patch)
treee34506afcd75a7cb263dc3fc0bab9497c1ee119b /sys/vm
parent0a2856a018c830e6331101f404bca0cb8a56373d (diff)
downloadFreeBSD-src-4aa815202930e674583ec1ac86cfe5f12f0238f7.zip
FreeBSD-src-4aa815202930e674583ec1ac86cfe5f12f0238f7.tar.gz
Removed unused fifth argument to vm_object_page_clean(). Fixed bug with
VTEXT not always getting cleared when it is supposed to. Added check to make sure that vm_object_remove() isn't called with a NULL pager or for a pager for an OBJ_INTERNAL object (neither of which will be on the hash list). Clear OBJ_CANPERSIST if we decide to terminate it because of no resident pages.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_map.c18
-rw-r--r--sys/vm/vm_object.c53
-rw-r--r--sys/vm/vm_object.h4
3 files changed, 40 insertions, 35 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 183b46a..db18908 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.17 1995/03/16 18:17:14 bde Exp $
+ * $Id: vm_map.c,v 1.18 1995/03/21 01:11:40 davidg Exp $
*/
/*
@@ -1499,14 +1499,16 @@ vm_map_clean(map, start, end, syncio, invalidate)
/*
* Flush pages if writing is allowed. XXX should we continue
* on an error?
+ *
+ * XXX Doing async I/O and then removing all the pages from
+ * the object before it completes is probably a very bad
+ * idea.
*/
- if ((current->protection & VM_PROT_WRITE) &&
- !vm_object_page_clean(object, offset, offset + size,
- syncio, FALSE)) {
- vm_object_unlock(object);
- vm_map_unlock_read(map);
- return (KERN_FAILURE);
- }
+ if (current->protection & VM_PROT_WRITE)
+#if 0
+ vm_object_page_clean(object, offset, offset + size, syncio);
+#endif
+ vm_object_page_clean(object, offset, offset + size, TRUE);
if (invalidate)
vm_object_page_remove(object, offset, offset + size, FALSE);
vm_object_unlock(object);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 216a2ee..69fbfd6 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.35 1995/03/21 01:11:42 davidg Exp $
+ * $Id: vm_object.c,v 1.36 1995/03/22 08:08:44 davidg Exp $
*/
/*
@@ -242,6 +242,7 @@ vm_object_deallocate(object)
vm_object_t object;
{
vm_object_t temp;
+ vm_pager_t pager;
while (object != NULL) {
@@ -312,35 +313,40 @@ vm_object_deallocate(object)
return;
}
+ pager = object->pager;
+
+ if (pager && pager->pg_type == PG_VNODE) {
+ vn_pager_t vnp = (vn_pager_t) pager->pg_data;
+
+ vnp->vnp_vp->v_flag &= ~VTEXT;
+ }
+
/*
* See if this object can persist and has some resident
* pages. If so, enter it in the cache.
*/
- if ((object->flags & OBJ_CANPERSIST) &&
- (object->resident_page_count != 0)) {
- vm_pager_t pager = object->pager;
- vn_pager_t vnp = (vn_pager_t) pager->pg_data;
-
- if (pager->pg_type == PG_VNODE) {
- vnp->vnp_vp->v_flag &= ~VTEXT;
- }
+ if (object->flags & OBJ_CANPERSIST) {
+ if (object->resident_page_count != 0) {
+ TAILQ_INSERT_TAIL(&vm_object_cached_list, object,
+ cached_list);
+ vm_object_cached++;
+ vm_object_cache_unlock();
- TAILQ_INSERT_TAIL(&vm_object_cached_list, object,
- cached_list);
- vm_object_cached++;
- vm_object_cache_unlock();
+ vm_object_unlock(object);
- vm_object_unlock(object);
-
- vm_object_cache_trim();
- return;
+ vm_object_cache_trim();
+ return;
+ } else {
+ object->flags &= ~OBJ_CANPERSIST;
+ }
}
/*
* Make sure no one can look us up now.
*/
object->flags |= OBJ_DEAD;
- vm_object_remove(object->pager);
+ if (pager != NULL && (object->flags & OBJ_INTERNAL) == 0)
+ vm_object_remove(pager);
vm_object_cache_unlock();
temp = object->shadow;
@@ -434,7 +440,7 @@ vm_object_terminate(object)
*/
if (vp != NULL) {
VOP_UNLOCK(vp);
- (void) vm_object_page_clean(object, 0, 0, TRUE, TRUE);
+ vm_object_page_clean(object, 0, 0, TRUE);
VOP_LOCK(vp);
vinvalbuf(vp, 0, NOCRED, NULL, 0, 0);
VOP_UNLOCK(vp);
@@ -484,15 +490,13 @@ vm_object_terminate(object)
* Odd semantics: if start == end, we clean everything.
*
* The object must be locked.
- * Returns true
*/
-boolean_t
-vm_object_page_clean(object, start, end, syncio, de_queue)
+void
+vm_object_page_clean(object, start, end, syncio)
register vm_object_t object;
register vm_offset_t start;
register vm_offset_t end;
boolean_t syncio;
- boolean_t de_queue;
{
register vm_page_t p, nextp;
int size;
@@ -540,8 +544,7 @@ again:
}
}
}
- wakeup((caddr_t) object);
- return 1;
+ return;
}
/*
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 84a058c..e65b8a5 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.h,v 1.14 1995/03/20 10:14:55 davidg Exp $
+ * $Id: vm_object.h,v 1.15 1995/03/21 01:11:43 davidg Exp $
*/
/*
@@ -174,7 +174,7 @@ void vm_object_deallocate __P((vm_object_t));
void vm_object_enter __P((vm_object_t, vm_pager_t));
void vm_object_init __P((vm_size_t));
vm_object_t vm_object_lookup __P((vm_pager_t));
-boolean_t vm_object_page_clean __P((vm_object_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t));
+void vm_object_page_clean __P((vm_object_t, vm_offset_t, vm_offset_t, boolean_t));
void vm_object_page_remove __P((vm_object_t, vm_offset_t, vm_offset_t, boolean_t));
void vm_object_pmap_copy __P((vm_object_t, vm_offset_t, vm_offset_t));
void vm_object_pmap_remove __P((vm_object_t, vm_offset_t, vm_offset_t));
OpenPOWER on IntegriCloud