- amap_extend: don't extend amap beyond UVM_AMAP_LARGE.

- uvm_map_enter: if we fail to extend amap, just give up merging instead of
  bailing out immediately.
This commit is contained in:
yamt 2005-05-05 01:58:51 +00:00
parent 2bfc59a549
commit ae24d5d705
2 changed files with 11 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_amap.c,v 1.58 2005/04/06 13:58:40 yamt Exp $ */
/* $NetBSD: uvm_amap.c,v 1.59 2005/05/05 01:58:51 yamt Exp $ */
/*
*
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.58 2005/04/06 13:58:40 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.59 2005/05/05 01:58:51 yamt Exp $");
#undef UVM_AMAP_INLINE /* enable/disable amap inlines */
@ -462,6 +462,11 @@ amap_extend(entry, addsize, flags)
*/
amap_unlock(amap); /* unlock in case we sleep in malloc */
if (slotneed >= UVM_AMAP_LARGE) {
return E2BIG;
}
slotalloc = malloc_roundup(slotneed * sizeof(int)) / sizeof(int);
#ifdef UVM_AMAP_PPREF
newppref = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.c,v 1.190 2005/04/29 09:05:21 yamt Exp $ */
/* $NetBSD: uvm_map.c,v 1.191 2005/05/05 01:58:51 yamt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.190 2005/04/29 09:05:21 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.191 2005/05/05 01:58:51 yamt Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@ -1052,7 +1052,7 @@ uvm_map_enter(struct vm_map *map, const struct uvm_map_args *args,
error = amap_extend(prev_entry, size,
amapwaitflag | AMAP_EXTEND_FORWARDS);
if (error)
goto done;
goto nomerge;
}
if (kmap)
@ -1175,7 +1175,7 @@ forwardmerge:
error = amap_extend(prev_entry->next, size,
amapwaitflag | AMAP_EXTEND_BACKWARDS);
if (error)
goto done;
goto nomerge;
}
}