Hi,

This diff is called 'vmmap_reaperyield.diff.1_flags_only'.  It's the
proper way forward for the reaperyield diff I mailed earlier.

This largely mechanical diff adds flags to uvm_unmap, uvmspace_free and
related functions.  The diff should have no functional change.  I need
this to make uvm_unmap pre-emptive (I need flag bits to tell me if I
should preempt or, in the reaper case, yield).  If nothing else, I think
it's a big step upward from using a boolean_t anyway.

I'll need this diff tested on many architectures.

I plan on putting this diff in before I put proper
pre-emptiveness/yielding in the code paths: this diff spans enough source
files as it is.

I'm not asking for oks yet, but once I do, it does mean extra commitance
to the new vmmap, since a backout gets really hard after this diff is
applied.

So please test this and let me know how it works out for you. :)
-- 
Ariane


Index: arch/i386/i386/pmap.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/pmap.c,v
retrieving revision 1.157
diff -u -d -p -r1.157 pmap.c
--- arch/i386/i386/pmap.c       9 Mar 2012 13:01:28 -0000       1.157
+++ arch/i386/i386/pmap.c       15 Apr 2012 22:16:40 -0000
@@ -1269,10 +1269,10 @@ pmap_free_pvpage(void)
                /* unmap the page */
                TAILQ_INIT(&dead_entries);
                uvm_unmap_remove(map, (vaddr_t)pvp, ((vaddr_t)pvp) + PAGE_SIZE,
-                   &dead_entries, FALSE, TRUE);
+                   &dead_entries, 0);
                vm_map_unlock(map);
 
-               uvm_unmap_detach(&dead_entries, 0);
+               uvm_unmap_detach(&dead_entries, 0, 0);
 
                pv_nfpvents -= PVE_PER_PVPAGE;  /* update free count */
        }
Index: arch/sparc/sparc/iommu.c
===================================================================
RCS file: /cvs/src/sys/arch/sparc/sparc/iommu.c,v
retrieving revision 1.25
diff -u -d -p -r1.25 iommu.c
--- arch/sparc/sparc/iommu.c    10 Jul 2010 19:32:25 -0000      1.25
+++ arch/sparc/sparc/iommu.c    15 Apr 2012 22:53:27 -0000
@@ -753,7 +753,7 @@ iommu_dmamem_unmap(bus_dma_tag_t t, void
        size = round_page(size);
        pmap_kremove((vaddr_t)kva, size);
        pmap_update(pmap_kernel());
-       uvm_unmap(kernel_map, (vaddr_t)kva, (vaddr_t)kva + size);
+       uvm_unmap(kernel_map, (vaddr_t)kva, (vaddr_t)kva + size, 0);
 }
 
 
Index: dev/pci/drm/i915_drv.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915_drv.c,v
retrieving revision 1.119
diff -u -d -p -r1.119 i915_drv.c
--- dev/pci/drm/i915_drv.c      9 Mar 2012 13:01:28 -0000       1.119
+++ dev/pci/drm/i915_drv.c      15 Apr 2012 22:53:48 -0000
@@ -4088,7 +4088,7 @@ i915_gem_cleanup_hws(struct inteldrm_sof
        obj = dev_priv->hws_obj;
 
        uvm_unmap(kernel_map, (vaddr_t)dev_priv->hw_status_page,
-           (vaddr_t)dev_priv->hw_status_page + PAGE_SIZE);
+           (vaddr_t)dev_priv->hw_status_page + PAGE_SIZE, 0);
        dev_priv->hw_status_page = NULL;
        drm_hold_object(obj);
        i915_gem_object_unpin(obj);
Index: kern/kern_exec.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_exec.c,v
retrieving revision 1.128
diff -u -d -p -r1.128 kern_exec.c
--- kern/kern_exec.c    12 Apr 2012 10:11:41 -0000      1.128
+++ kern/kern_exec.c    15 Apr 2012 22:51:13 -0000
@@ -825,7 +825,7 @@ exec_sigcode_map(struct proc *p, struct 
                        return (ENOMEM);
                }
                memcpy((void *)va, e->e_sigcode, sz);
-               uvm_unmap(kernel_map, va, va + round_page(sz));
+               uvm_unmap(kernel_map, va, va + round_page(sz), 0);
        }
 
        p->p_sigcode = 0; /* no hint */
Index: kern/kern_malloc_debug.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_malloc_debug.c,v
retrieving revision 1.28
diff -u -d -p -r1.28 kern_malloc_debug.c
--- kern/kern_malloc_debug.c    28 Jul 2011 14:07:01 -0000      1.28
+++ kern/kern_malloc_debug.c    15 Apr 2012 22:54:21 -0000
@@ -259,7 +259,7 @@ debug_malloc_allocate_free(int wait)
                        break;
 
                if (wait == 0) {
-                       uvm_unmap(kmem_map, va, va + PAGE_SIZE * 2);
+                       uvm_unmap(kmem_map, va, va + PAGE_SIZE * 2, 0);
                        pool_put(&debug_malloc_pool, md);
                        return;
                }
Index: kern/kern_sysctl.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_sysctl.c,v
retrieving revision 1.220
diff -u -d -p -r1.220 kern_sysctl.c
--- kern/kern_sysctl.c  12 Apr 2012 14:59:19 -0000      1.220
+++ kern/kern_sysctl.c  15 Apr 2012 22:45:38 -0000
@@ -1748,7 +1748,7 @@ more:
        error = copyout(&rarg, rargv, sizeof(rarg));
 
 out:
-       uvmspace_free(vm);
+       uvmspace_free(vm, 0);
        free(buf, M_TEMP);
        return (error);
 }
Index: kern/sys_process.c
===================================================================
RCS file: /cvs/src/sys/kern/sys_process.c,v
retrieving revision 1.55
diff -u -d -p -r1.55 sys_process.c
--- kern/sys_process.c  12 Apr 2012 14:40:41 -0000      1.55
+++ kern/sys_process.c  15 Apr 2012 22:46:05 -0000
@@ -721,7 +721,7 @@ process_domem(struct proc *curp, struct 
        error = uvm_io(&vm->vm_map, uio,
            (req == PT_WRITE_I) ? UVM_IO_FIXPROT : 0);
 
-       uvmspace_free(vm);
+       uvmspace_free(vm, 0);
 
        if (error == 0 && req == PT_WRITE_I)
                pmap_proc_iflush(p, addr, len);
Index: miscfs/procfs/procfs_cmdline.c
===================================================================
RCS file: /cvs/src/sys/miscfs/procfs/procfs_cmdline.c,v
retrieving revision 1.10
diff -u -d -p -r1.10 procfs_cmdline.c
--- miscfs/procfs/procfs_cmdline.c      10 Mar 2012 05:54:28 -0000      1.10
+++ miscfs/procfs/procfs_cmdline.c      15 Apr 2012 22:46:35 -0000
@@ -180,7 +180,7 @@ procfs_docmdline(struct proc *curp, stru
 
 
  bad:
-       uvmspace_free(vm);
+       uvmspace_free(vm, 0);
        free(arg, M_TEMP);
        return (error);
 }
Index: uvm/uvm_extern.h
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_extern.h,v
retrieving revision 1.104
diff -u -d -p -r1.104 uvm_extern.h
--- uvm/uvm_extern.h    9 Mar 2012 13:01:29 -0000       1.104
+++ uvm/uvm_extern.h    15 Apr 2012 22:43:51 -0000
@@ -236,6 +236,12 @@ typedef int                vm_prot_t;
 #define        PHYSLOAD_DEVICE 0x01    /* don't add to the page queue */
 
 /*
+ * Flags to uvm_unmap_detach.
+ */
+#define UVM_UNMAP_NO_FREE      0x0001  /* Don't mark unmapped as free. */
+#define UVM_UNMAP_RM_HOLES     0x0002  /* Also remove holes in the map. */
+
+/*
  * structures
  */
 
@@ -661,7 +667,7 @@ void                        uvmspace_init(struct vmspace *, 
s
                                vaddr_t, vaddr_t, boolean_t, boolean_t);
 void                   uvmspace_exec(struct proc *, vaddr_t, vaddr_t);
 struct vmspace         *uvmspace_fork(struct vmspace *);
-void                   uvmspace_free(struct vmspace *);
+void                   uvmspace_free(struct vmspace *, int);
 void                   uvmspace_share(struct proc *, struct proc *);
 
 
Index: uvm/uvm_glue.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_glue.c,v
retrieving revision 1.59
diff -u -d -p -r1.59 uvm_glue.c
--- uvm/uvm_glue.c      23 Mar 2012 15:51:26 -0000      1.59
+++ uvm/uvm_glue.c      15 Apr 2012 22:47:24 -0000
@@ -347,7 +347,7 @@ uvm_fork(struct proc *p1, struct proc *p
 void
 uvm_exit(struct proc *p)
 {
-       uvmspace_free(p->p_vmspace);
+       uvmspace_free(p->p_vmspace, 0);
        p->p_vmspace = NULL;
        uvm_km_free(kernel_map, (vaddr_t)p->p_addr, USPACE);
        p->p_addr = NULL;
Index: uvm/uvm_io.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_io.c,v
retrieving revision 1.20
diff -u -d -p -r1.20 uvm_io.c
--- uvm/uvm_io.c        9 Mar 2012 13:01:29 -0000       1.20
+++ uvm/uvm_io.c        15 Apr 2012 22:14:38 -0000
@@ -141,9 +141,9 @@ uvm_io(vm_map_t map, struct uio *uio, in
                vm_map_lock(kernel_map);
                TAILQ_INIT(&dead_entries);
                uvm_unmap_remove(kernel_map, kva, kva+chunksz,
-                   &dead_entries, FALSE, TRUE);
+                   &dead_entries, 0);
                vm_map_unlock(kernel_map);
-               uvm_unmap_detach(&dead_entries, AMAP_REFALL);
+               uvm_unmap_detach(&dead_entries, AMAP_REFALL, 0);
 
                /*
                 * We defer checking the error return from uiomove until
Index: uvm/uvm_km.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_km.c,v
retrieving revision 1.107
diff -u -d -p -r1.107 uvm_km.c
--- uvm/uvm_km.c        9 Mar 2012 13:01:29 -0000       1.107
+++ uvm/uvm_km.c        15 Apr 2012 22:50:35 -0000
@@ -415,7 +415,7 @@ uvm_km_kmemalloc_pla(struct vm_map *map,
        if (uvm_pglistalloc(size, low, high, alignment, boundary, &pgl, nsegs,
            pla_flags) != 0) {
                /* Failed. */
-               uvm_unmap(map, kva, kva + size);
+               uvm_unmap(map, kva, kva + size, 0);
                return (0);
        }
 
@@ -456,7 +456,7 @@ uvm_km_kmemalloc_pla(struct vm_map *map,
 void
 uvm_km_free(struct vm_map *map, vaddr_t addr, vsize_t size)
 {
-       uvm_unmap(map, trunc_page(addr), round_page(addr+size));
+       uvm_unmap(map, trunc_page(addr), round_page(addr+size), 0);
 }
 
 /*
@@ -474,11 +474,11 @@ uvm_km_free_wakeup(struct vm_map *map, v
        vm_map_lock(map);
        TAILQ_INIT(&dead_entries);
        uvm_unmap_remove(map, trunc_page(addr), round_page(addr+size), 
-            &dead_entries, FALSE, TRUE);
+            &dead_entries, 0);
        wakeup(map);
        vm_map_unlock(map);
 
-       uvm_unmap_detach(&dead_entries, 0);
+       uvm_unmap_detach(&dead_entries, 0, 0);
 }
 
 /*
@@ -536,7 +536,7 @@ uvm_km_alloc1(struct vm_map *map, vsize_
                                 * sleep for memory, so free what we have
                                 * allocated and fail.
                                 */
-                               uvm_unmap(map, kva, loopva - kva);
+                               uvm_unmap(map, kva, loopva - kva, 0);
                                return (0);
                        } else {
                                uvm_wait("km_alloc1w"); /* wait for memory */
@@ -809,7 +809,7 @@ uvm_km_thread(void *arg)
                        for (; i < nitems(pg); i++) {
                                if (pg[i] != 0) {
                                        uvm_unmap(kernel_map,
-                                           pg[i], pg[i] + PAGE_SIZE);
+                                           pg[i], pg[i] + PAGE_SIZE, 0);
                                }
                        }
                }
@@ -840,7 +840,7 @@ uvm_km_doputpage(struct uvm_km_free_page
        mtx_leave(&uvm_km_pages.mtx);
 
        if (freeva)
-               uvm_unmap(kernel_map, va, va + PAGE_SIZE);
+               uvm_unmap(kernel_map, va, va + PAGE_SIZE, 0);
 
        uvm_pagefree(pg);
        return (nextfp);
@@ -1043,7 +1043,7 @@ km_free(void *v, size_t sz, const struct
                uvm_pglistfree(&pgl);
        }
 free_va:
-       uvm_unmap(*kv->kv_map, sva, eva);
+       uvm_unmap(*kv->kv_map, sva, eva, 0);
        if (kv->kv_wait)
                wakeup(*kv->kv_map);
 }
Index: uvm/uvm_map.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_map.c,v
retrieving revision 1.151
diff -u -d -p -r1.151 uvm_map.c
--- uvm/uvm_map.c       11 Apr 2012 11:23:22 -0000      1.151
+++ uvm/uvm_map.c       15 Apr 2012 22:48:35 -0000
@@ -137,7 +137,7 @@ int                  uvm_map_pageable_wire(struct vm_m
                            vaddr_t, vaddr_t, int);
 void                    uvm_map_setup_entries(struct vm_map*);
 void                    uvm_map_setup_md(struct vm_map*);
-void                    uvm_map_teardown(struct vm_map*);
+void                    uvm_map_teardown(struct vm_map*, int);
 void                    uvm_map_vmspace_update(struct vm_map*,
                            struct uvm_map_deadq*, int);
 void                    uvm_map_kmem_grow(struct vm_map*,
@@ -1208,7 +1208,7 @@ unlock:
         * uvm_map_mkentry may also create dead entries, when it attempts to
         * destroy free-space entries.
         */
-       uvm_unmap_detach(&dead, 0);
+       uvm_unmap_detach(&dead, 0, 0);
        return error;
 }
 
@@ -1364,7 +1364,7 @@ uvm_mapent_tryjoin(struct vm_map *map, s
  * Kill entries that are no longer in a map.
  */
 void
-uvm_unmap_detach(struct uvm_map_deadq *deadq, int flags)
+uvm_unmap_detach(struct uvm_map_deadq *deadq, int amapflags, int flags)
 {
        struct vm_map_entry *entry;
 
@@ -1376,7 +1376,7 @@ uvm_unmap_detach(struct uvm_map_deadq *d
                        amap_unref(entry->aref.ar_amap,
                            entry->aref.ar_pageoff,
                            atop(entry->end - entry->start),
-                           flags);
+                           amapflags);
 
                /*
                 * Drop reference to our backing object, if we've got one.
@@ -1634,18 +1634,19 @@ uvm_map_pie(vaddr_t align)
 }
 
 void
-uvm_unmap(struct vm_map *map, vaddr_t start, vaddr_t end)
+uvm_unmap(struct vm_map *map, vaddr_t start, vaddr_t end, int flags)
 {
        struct uvm_map_deadq dead;
 
        KASSERT((start & (vaddr_t)PAGE_MASK) == 0 &&
            (end & (vaddr_t)PAGE_MASK) == 0);
+
        TAILQ_INIT(&dead);
        vm_map_lock(map);
-       uvm_unmap_remove(map, start, end, &dead, FALSE, TRUE);
+       uvm_unmap_remove(map, start, end, &dead, flags);
        vm_map_unlock(map);
 
-       uvm_unmap_detach(&dead, 0);
+       uvm_unmap_detach(&dead, 0, flags);
 }
 
 /*
@@ -1782,14 +1783,13 @@ uvm_unmap_kill_entry(struct vm_map *map,
 /*
  * Remove all entries from start to end.
  *
- * If remove_holes, then remove ET_HOLE entries as well.
- * If markfree, entry will be properly marked free, otherwise, no replacement
- * entry will be put in the tree (corrupting the tree).
+ * If UVM_UNMAP_RM_HOLES, then remove ET_HOLE entries as well.
+ * If UVM_UNMAP_FREE, entry will be properly marked free, otherwise,
+ * no replacement entry will be put in the tree (corrupting the tree).
  */
 void
 uvm_unmap_remove(struct vm_map *map, vaddr_t start, vaddr_t end,
-    struct uvm_map_deadq *dead, boolean_t remove_holes,
-    boolean_t markfree)
+    struct uvm_map_deadq *dead, int flags)
 {
        struct vm_map_entry *prev_hint, *next, *entry;
 
@@ -1808,7 +1808,7 @@ uvm_unmap_remove(struct vm_map *map, vad
         */
        entry = uvm_map_entrybyaddr(&map->addr, start);
        KDASSERT(entry != NULL && entry->start <= start);
-       if (entry->end <= start && markfree)
+       if (entry->end <= start && !(flags & UVM_UNMAP_NO_FREE))
                entry = RB_NEXT(uvm_map_addr, &map->addr, entry);
        else
                UVM_MAP_CLIP_START(map, entry, start);
@@ -1820,14 +1820,14 @@ uvm_unmap_remove(struct vm_map *map, vad
        prev_hint = NULL;
        for (; entry != NULL && entry->start < end; entry = next) {
                KDASSERT(entry->start >= start);
-               if (entry->end > end || !markfree)
+               if (entry->end > end || (flags & UVM_UNMAP_NO_FREE))
                        UVM_MAP_CLIP_END(map, entry, end);
                KDASSERT(entry->start >= start && entry->end <= end);
                next = RB_NEXT(uvm_map_addr, &map->addr, entry);
 
                /* Don't remove holes unless asked to do so. */
                if (UVM_ET_ISHOLE(entry)) {
-                       if (!remove_holes) {
+                       if (!(flags & UVM_UNMAP_RM_HOLES)) {
                                prev_hint = entry;
                                continue;
                        }
@@ -1851,13 +1851,14 @@ uvm_unmap_remove(struct vm_map *map, vad
                /*
                 * Actual removal of entry.
                 */
-               uvm_mapent_mkfree(map, entry, &prev_hint, dead, markfree);
+               uvm_mapent_mkfree(map, entry, &prev_hint, dead,
+                   !(flags & UVM_UNMAP_NO_FREE));
        }
 
        pmap_update(vm_map_pmap(map));
 
 #ifdef VMMAP_DEBUG
-       if (markfree) {
+       if (!(flags & UVM_UNMAP_NO_FREE)) {
                for (entry = uvm_map_entrybyaddr(&map->addr, start);
                    entry != NULL && entry->start < end;
                    entry = RB_NEXT(uvm_map_addr, &map->addr, entry)) {
@@ -2298,7 +2299,7 @@ uvm_map_setup(struct vm_map *map, vaddr_
  * This is the inverse operation to uvm_map_setup.
  */
 void
-uvm_map_teardown(struct vm_map *map)
+uvm_map_teardown(struct vm_map *map, int flags)
 {
        struct uvm_map_deadq     dead_entries;
        int                      i;
@@ -2307,6 +2308,9 @@ uvm_map_teardown(struct vm_map *map)
        size_t                   numq, numt;
 #endif
 
+       /* Flags argument is not yet in use. */
+       KASSERT(flags == 0);
+
        if ((map->flags & VM_MAP_INTRSAFE) == 0) {
                if (rw_enter(&map->lock, RW_NOSLEEP | RW_WRITE) != 0)
                        panic("uvm_map_teardown: rw_enter failed on free map");
@@ -2365,7 +2369,7 @@ uvm_map_teardown(struct vm_map *map)
                numq++;
        KASSERT(numt == numq);
 #endif
-       uvm_unmap_detach(&dead_entries, 0);
+       uvm_unmap_detach(&dead_entries, 0, flags);
        pmap_destroy(map->pmap);
        map->pmap = NULL;
 }
@@ -3165,7 +3169,7 @@ uvmspace_exec(struct proc *p, vaddr_t st
                 * (as in, not replace them with free-memory entries).
                 */
                uvm_unmap_remove(map, map->min_offset, map->max_offset,
-                   &dead_entries, TRUE, FALSE);
+                   &dead_entries, UVM_UNMAP_NO_FREE | UVM_UNMAP_RM_HOLES);
 
                KDASSERT(RB_EMPTY(&map->addr));
 
@@ -3213,13 +3217,13 @@ uvmspace_exec(struct proc *p, vaddr_t st
                p->p_vmspace = nvm;
                pmap_activate(p);
 
-               uvmspace_free(ovm);
+               uvmspace_free(ovm, 0);
        }
 
        /*
         * Release dead entries
         */
-       uvm_unmap_detach(&dead_entries, 0);
+       uvm_unmap_detach(&dead_entries, 0, 0);
 }
 
 /*
@@ -3229,7 +3233,7 @@ uvmspace_exec(struct proc *p, vaddr_t st
  */
 
 void
-uvmspace_free(struct vmspace *vm)
+uvmspace_free(struct vmspace *vm, int flags)
 {
        if (--vm->vm_refcnt == 0) {
                /*
@@ -3243,7 +3247,7 @@ uvmspace_free(struct vmspace *vm)
                        shmexit(vm);
 #endif
 
-               uvm_map_teardown(&vm->vm_map);
+               uvm_map_teardown(&vm->vm_map, flags);
                pool_put(&uvm_vmspace_pool, vm);
        }
 }
@@ -3591,7 +3595,7 @@ uvmspace_fork(struct vmspace *vm1)
         * This can actually happen, if multiple entries described a
         * space in which an entry was inherited.
         */
-       uvm_unmap_detach(&dead, 0);
+       uvm_unmap_detach(&dead, 0, 0);
 
 #ifdef SYSVSHM
        if (vm1->vm_shm)
@@ -3748,30 +3752,20 @@ void
 uvm_map_deallocate(vm_map_t map)
 {
        int c;
-       struct uvm_map_deadq dead;
 
        simple_lock(&map->ref_lock);
        c = --map->ref_count;
        simple_unlock(&map->ref_lock);
-       if (c > 0) {
+       if (c > 0)
                return;
-       }
 
        /*
         * all references gone.   unmap and free.
         *
         * No lock required: we are only one to access this map.
         */
-
-       TAILQ_INIT(&dead);
-       uvm_tree_sanity(map, __FILE__, __LINE__);
-       uvm_unmap_remove(map, map->min_offset, map->max_offset, &dead,
-           TRUE, FALSE);
-       pmap_destroy(map->pmap);
-       KASSERT(RB_EMPTY(&map->addr));
+       uvm_map_teardown(map, 0);
        free(map, M_VMMAP);
-
-       uvm_unmap_detach(&dead, 0);
 }
 
 /* 
@@ -4025,10 +4019,8 @@ uvm_map_extract(struct vm_map *srcmap, v
         * Unmap copied entries on failure.
         */
 fail2_unmap:
-       if (error) {
-               uvm_unmap_remove(kernel_map, dstaddr, dstaddr + len, &dead,
-                   FALSE, TRUE);
-       }
+       if (error)
+               uvm_unmap_remove(kernel_map, dstaddr, dstaddr + len, &dead, 0);
 
        /*
         * Release maps, release dead entries.
@@ -4039,7 +4031,7 @@ fail2:
 fail:
        vm_map_unlock(srcmap);
 
-       uvm_unmap_detach(&dead, 0);
+       uvm_unmap_detach(&dead, 0, 0);
 
        return error;
 }
@@ -4618,7 +4610,7 @@ uvm_map_set_uaddr(struct vm_map *map, st
 
        uvm_map_freelist_update_refill(map, 0);
        vm_map_unlock(map);
-       uvm_unmap_detach(&dead, 0);
+       uvm_unmap_detach(&dead, 0, 0);
 }
 
 /*
Index: uvm/uvm_map.h
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_map.h,v
retrieving revision 1.48
diff -u -d -p -r1.48 uvm_map.h
--- uvm/uvm_map.h       11 Apr 2012 11:23:22 -0000      1.48
+++ uvm/uvm_map.h       15 Apr 2012 22:40:52 -0000
@@ -397,14 +397,14 @@ int               uvm_map_reserve(vm_map_t, vsize_t, 
                    vaddr_t *);
 void           uvm_map_setup(vm_map_t, vaddr_t, vaddr_t, int);
 int            uvm_map_submap(vm_map_t, vaddr_t, vaddr_t, vm_map_t);
-void           uvm_unmap(vm_map_t, vaddr_t, vaddr_t);
+void           uvm_unmap(vm_map_t, vaddr_t, vaddr_t, int);
 void           uvm_map_set_uaddr(struct vm_map*, struct uvm_addr_state**,
                    struct uvm_addr_state*);
 int            uvm_map_mquery(struct vm_map*, vaddr_t*, vsize_t, voff_t, int);
 
-void           uvm_unmap_detach(struct uvm_map_deadq*, int);
+void           uvm_unmap_detach(struct uvm_map_deadq*, int, int);
 void           uvm_unmap_remove(struct vm_map*, vaddr_t, vaddr_t,
-                   struct uvm_map_deadq*, boolean_t, boolean_t);
+                   struct uvm_map_deadq*, int);
 
 #endif /* _KERNEL */
 
Index: uvm/uvm_mmap.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_mmap.c,v
retrieving revision 1.89
diff -u -d -p -r1.89 uvm_mmap.c
--- uvm/uvm_mmap.c      10 Apr 2012 10:30:44 -0000      1.89
+++ uvm/uvm_mmap.c      15 Apr 2012 22:56:54 -0000
@@ -660,11 +660,11 @@ sys_munmap(struct proc *p, void *v, regi
         * doit!
         */
        TAILQ_INIT(&dead_entries);
-       uvm_unmap_remove(map, addr, addr + size, &dead_entries, FALSE, TRUE);
+       uvm_unmap_remove(map, addr, addr + size, &dead_entries, 0);
 
        vm_map_unlock(map);     /* and unlock */
 
-       uvm_unmap_detach(&dead_entries, 0);
+       uvm_unmap_detach(&dead_entries, 0, 0);
 
        return (0);
 }
@@ -995,7 +995,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vs
                if (*addr & PAGE_MASK)
                        return(EINVAL);
                uvmflag |= UVM_FLAG_FIXED;
-               uvm_unmap(map, *addr, *addr + size);    /* zap! */
+               uvm_unmap(map, *addr, *addr + size, 0);
        }
 
        /*
@@ -1116,7 +1116,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vs
                                error = ENOMEM;
                                vm_map_unlock(map);
                                /* unmap the region! */
-                               uvm_unmap(map, *addr, *addr + size);
+                               uvm_unmap(map, *addr, *addr + size, 0);
                                goto bad;
                        }
                        /*
@@ -1127,7 +1127,7 @@ uvm_mmap(vm_map_t map, vaddr_t *addr, vs
                            FALSE, UVM_LK_ENTER);
                        if (error != 0) {
                                /* unmap the region! */
-                               uvm_unmap(map, *addr, *addr + size);
+                               uvm_unmap(map, *addr, *addr + size, 0);
                                goto bad;
                        }
                        return (0);
Index: uvm/uvm_user.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_user.c,v
retrieving revision 1.11
diff -u -d -p -r1.11 uvm_user.c
--- uvm/uvm_user.c      27 Apr 2007 17:01:54 -0000      1.11
+++ uvm/uvm_user.c      15 Apr 2012 22:57:23 -0000
@@ -60,5 +60,5 @@ uvm_deallocate(struct vm_map *map, vaddr
        if (size == 0)
                return;
 
-       uvm_unmap(map, trunc_page(start), round_page(start+size));
+       uvm_unmap(map, trunc_page(start), round_page(start+size), 0);
 }

Reply via email to