Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_map_enter: don't bother to defer amap allocation...



details:   https://anonhg.NetBSD.org/src/rev/ffd3448cef67
branches:  trunk
changeset: 580547:ffd3448cef67
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Apr 29 09:05:21 2005 +0000

description:
uvm_map_enter: don't bother to defer amap allocation if there's a mergable
existing entry.  although there're merits and demerits, i think it benefits
common cases.

diffstat:

 sys/uvm/uvm_map.c |  18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r fc80be109e80 -r ffd3448cef67 sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Fri Apr 29 08:38:33 2005 +0000
+++ b/sys/uvm/uvm_map.c Fri Apr 29 09:05:21 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.189 2005/04/28 14:40:43 yamt Exp $       */
+/*     $NetBSD: uvm_map.c,v 1.190 2005/04/29 09:05:21 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.189 2005/04/28 14:40:43 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.190 2005/04/29 09:05:21 yamt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -1010,14 +1010,17 @@
        if (flags & UVM_FLAG_NOMERGE)
                goto nomerge;
 
-       if (prev_entry->etype == newetype &&
-           prev_entry->end == start &&
+       if (prev_entry->end == start &&
            prev_entry != &map->header &&
            prev_entry->object.uvm_obj == uobj) {
 
                if ((prev_entry->flags & meflagmask) != meflagval)
                        goto forwardmerge;
 
+               if (prev_entry->etype != newetype &&
+                   (prev_entry->etype | UVM_ET_NEEDSCOPY) != newetype)
+                       goto forwardmerge;
+
                if (uobj && prev_entry->offset +
                    (prev_entry->end - prev_entry->start) != uoffset)
                        goto forwardmerge;
@@ -1076,14 +1079,17 @@
        }
 
 forwardmerge:
-       if (prev_entry->next->etype == newetype &&
-           prev_entry->next->start == (start + size) &&
+       if (prev_entry->next->start == (start + size) &&
            prev_entry->next != &map->header &&
            prev_entry->next->object.uvm_obj == uobj) {
 
                if ((prev_entry->next->flags & meflagmask) != meflagval)
                        goto nomerge;
 
+               if (prev_entry->next->etype != newetype &&
+                   (prev_entry->next->etype | UVM_ET_NEEDSCOPY) != newetype)
+                       goto nomerge;
+
                if (uobj && prev_entry->next->offset != uoffset + size)
                        goto nomerge;
 



Home | Main Index | Thread Index | Old Index