1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

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.
This commit is contained in:
Matthew Dillon 1999-02-03 01:57:17 +00:00
parent 7686a20048
commit 4112823fc7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43547
2 changed files with 11 additions and 9 deletions

View File

@ -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,

View File

@ -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);
}