Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm - amap_extend: don't extend amap beyond UVM_AMAP_LARGE.



details:   https://anonhg.NetBSD.org/src/rev/281926a26726
branches:  trunk
changeset: 580706:281926a26726
user:      yamt <yamt%NetBSD.org@localhost>
date:      Thu May 05 01:58:51 2005 +0000

description:
- 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.

diffstat:

 sys/uvm/uvm_amap.c |  9 +++++++--
 sys/uvm/uvm_map.c  |  8 ++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r 943a259cb14d -r 281926a26726 sys/uvm/uvm_amap.c
--- a/sys/uvm/uvm_amap.c        Thu May 05 01:28:57 2005 +0000
+++ b/sys/uvm/uvm_amap.c        Thu May 05 01:58:51 2005 +0000
@@ -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_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;
diff -r 943a259cb14d -r 281926a26726 sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Thu May 05 01:28:57 2005 +0000
+++ b/sys/uvm/uvm_map.c Thu May 05 01:58:51 2005 +0000
@@ -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 @@
                        error = amap_extend(prev_entry, size,
                            amapwaitflag | AMAP_EXTEND_FORWARDS);
                        if (error)
-                               goto done;
+                               goto nomerge;
                }
 
                if (kmap)
@@ -1175,7 +1175,7 @@
                                error = amap_extend(prev_entry->next, size,
                                    amapwaitflag | AMAP_EXTEND_BACKWARDS);
                                if (error)
-                                       goto done;
+                                       goto nomerge;
                        }
                }
 



Home | Main Index | Thread Index | Old Index