diff options
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r-- | sys/geom/geom_io.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 25a90de..0e79920 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include <sys/proc.h> #include <sys/stack.h> #include <sys/sysctl.h> +#include <sys/vmem.h> #include <sys/errno.h> #include <geom/geom.h> @@ -626,7 +627,6 @@ g_io_transient_map_bio(struct bio *bp) vm_offset_t addr; long size; u_int retried; - int rv; KASSERT(unmapped_buf_allowed, ("unmapped disabled")); @@ -636,10 +636,7 @@ g_io_transient_map_bio(struct bio *bp) retried = 0; atomic_add_long(&transient_maps, 1); retry: - vm_map_lock(bio_transient_map); - if (vm_map_findspace(bio_transient_map, vm_map_min(bio_transient_map), - size, &addr)) { - vm_map_unlock(bio_transient_map); + if (vmem_alloc(transient_arena, size, M_BESTFIT | M_NOWAIT, &addr)) { if (transient_map_retries != 0 && retried >= transient_map_retries) { g_io_deliver(bp, EDEADLK/* XXXKIB */); @@ -651,7 +648,7 @@ retry: /* * Naive attempt to quisce the I/O to get more * in-flight requests completed and defragment - * the bio_transient_map. + * the transient_arena. */ CTR3(KTR_GEOM, "g_down retrymap bp %p provider %s r %d", bp, bp->bio_to->name, retried); @@ -661,12 +658,6 @@ retry: goto retry; } } - rv = vm_map_insert(bio_transient_map, NULL, 0, addr, addr + size, - VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); - KASSERT(rv == KERN_SUCCESS, - ("vm_map_insert(bio_transient_map) rv %d %jx %lx", - rv, (uintmax_t)addr, size)); - vm_map_unlock(bio_transient_map); atomic_add_int(&inflight_transient_maps, 1); pmap_qenter((vm_offset_t)addr, bp->bio_ma, OFF_TO_IDX(size)); bp->bio_data = (caddr_t)addr + bp->bio_ma_offset; |