summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-02-03 01:57:17 +0000
committerdillon <dillon@FreeBSD.org>1999-02-03 01:57:17 +0000
commitfdc78db6063a8c522099f73e41637d50ae429804 (patch)
treef0d690e98345f23039c8bd32c979957261e36d4a
parent4bdbe56100e30191cdfe0bb9e8a1ac2db717527d (diff)
downloadFreeBSD-src-fdc78db6063a8c522099f73e41637d50ae429804.zip
FreeBSD-src-fdc78db6063a8c522099f73e41637d50ae429804.tar.gz
Submitted by: Alan Cox
The vm_map_insert()/vm_object_coalesce() optimization has been extended to include OBJT_SWAP objects as well as OBJT_DEFAULT objects. This is possible because it costs nothing to extend an OBJT_SWAP object with the new swapper. We can't do this with the old swapper. The old swapper used a linear array that would have had to have been reallocated, costing time as well as a potential low-memory deadlock.
-rw-r--r--sys/vm/vm_map.c15
-rw-r--r--sys/vm/vm_object.c5
2 files changed, 11 insertions, 9 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index b656b5b..a133739 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.145 1999/01/31 14:09:25 julian Exp $
+ * $Id: vm_map.c,v 1.146 1999/02/01 08:49:30 dillon Exp $
*/
/*
@@ -488,15 +488,16 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
* neighbors. Or at least extend the object.
*/
- if ((object == NULL) &&
+ if (
+ (object == NULL) &&
(prev_entry != &map->header) &&
- (( prev_entry->eflags & (MAP_ENTRY_IS_A_MAP | MAP_ENTRY_IS_SUB_MAP)) == 0) &&
+ ((prev_entry->eflags & (MAP_ENTRY_IS_A_MAP | MAP_ENTRY_IS_SUB_MAP)) == 0) &&
((prev_entry->object.vm_object == NULL) ||
- (prev_entry->object.vm_object->type == OBJT_DEFAULT)) &&
+ (prev_entry->object.vm_object->type == OBJT_DEFAULT) ||
+ (prev_entry->object.vm_object->type == OBJT_SWAP)) &&
(prev_entry->end == start) &&
- (prev_entry->wired_count == 0)) {
-
-
+ (prev_entry->wired_count == 0)
+ ) {
if ((protoeflags == prev_entry->eflags) &&
((cow & MAP_NOFAULT) ||
vm_object_coalesce(prev_entry->object.vm_object,
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 9f5b999..14e5486 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.141 1999/01/24 01:01:38 dillon Exp $
+ * $Id: vm_object.c,v 1.142 1999/01/28 00:57:57 dillon Exp $
*/
/*
@@ -1459,7 +1459,8 @@ vm_object_coalesce(prev_object, prev_pindex, prev_size, next_size)
return (TRUE);
}
- if (prev_object->type != OBJT_DEFAULT) {
+ if (prev_object->type != OBJT_DEFAULT &&
+ prev_object->type != OBJT_SWAP) {
return (FALSE);
}
OpenPOWER on IntegriCloud