Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm don't merge incompatible map entries. eg. private a...



details:   https://anonhg.NetBSD.org/src/rev/b85c2f0defbe
branches:  trunk
changeset: 572392:b85c2f0defbe
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Jan 01 21:11:51 2005 +0000

description:
don't merge incompatible map entries.  eg. private and shared.

diffstat:

 sys/uvm/uvm_map.c |  40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diffs (103 lines):

diff -r 1dbc2f0b7f4e -r b85c2f0defbe sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Sat Jan 01 21:09:56 2005 +0000
+++ b/sys/uvm/uvm_map.c Sat Jan 01 21:11:51 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.175 2005/01/01 21:02:13 yamt Exp $       */
+/*     $NetBSD: uvm_map.c,v 1.176 2005/01/01 21:11: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.175 2005/01/01 21:02:13 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.176 2005/01/01 21:11:51 yamt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -937,6 +937,7 @@
        const int kmap = (vm_map_pmap(map) == pmap_kernel());
        int merged = 0;
        int error;
+       int newetype;
 
        UVMHIST_FUNC("uvm_map_enter");
        UVMHIST_CALLED(maphist);
@@ -950,6 +951,17 @@
                KASSERT(new_entry->flags & UVM_MAP_QUANTUM);
        }
 
+       if (uobj)
+               newetype = UVM_ET_OBJ;
+       else
+               newetype = 0;
+
+       if (flags & UVM_FLAG_COPYONW) {
+               newetype |= UVM_ET_COPYONWRITE;
+               if ((flags & UVM_FLAG_OVERLAY) == 0)
+                       newetype |= UVM_ET_NEEDSCOPY;
+       }
+
        /*
         * try and insert in map by extending previous entry, if possible.
         * XXX: we don't try and pull back the next entry.   might be useful
@@ -959,7 +971,8 @@
        if (flags & UVM_FLAG_NOMERGE)
                goto nomerge;
 
-       if (prev_entry->end == start &&
+       if (prev_entry->etype == newetype &&
+           prev_entry->end == start &&
            prev_entry != &map->header &&
            prev_entry->object.uvm_obj == uobj) {
 
@@ -970,9 +983,6 @@
                    (prev_entry->end - prev_entry->start) != uoffset)
                        goto forwardmerge;
 
-               if (UVM_ET_ISSUBMAP(prev_entry))
-                       goto forwardmerge;
-
                if (prev_entry->protection != prot ||
                    prev_entry->max_protection != maxprot)
                        goto forwardmerge;
@@ -1027,7 +1037,8 @@
        }
 
 forwardmerge:
-       if (prev_entry->next->start == (start + size) &&
+       if (prev_entry->next->etype == newetype &&
+           prev_entry->next->start == (start + size) &&
            prev_entry->next != &map->header &&
            prev_entry->next->object.uvm_obj == uobj) {
 
@@ -1037,9 +1048,6 @@
                if (uobj && prev_entry->next->offset != uoffset + size)
                        goto nomerge;
 
-               if (UVM_ET_ISSUBMAP(prev_entry->next))
-                       goto nomerge;
-
                if (prev_entry->next->protection != prot ||
                    prev_entry->next->max_protection != maxprot)
                        goto nomerge;
@@ -1197,16 +1205,8 @@
                new_entry->object.uvm_obj = uobj;
                new_entry->offset = uoffset;
 
-               if (uobj)
-                       new_entry->etype = UVM_ET_OBJ;
-               else
-                       new_entry->etype = 0;
-
-               if (flags & UVM_FLAG_COPYONW) {
-                       new_entry->etype |= UVM_ET_COPYONWRITE;
-                       if ((flags & UVM_FLAG_OVERLAY) == 0)
-                               new_entry->etype |= UVM_ET_NEEDSCOPY;
-               }
+               new_entry->etype = newetype;
+
                if (flags & UVM_FLAG_NOMERGE) {
                        new_entry->flags |= UVM_MAP_NOMERGE;
                }



Home | Main Index | Thread Index | Old Index