From d1f42ac2eeb2bdff11ace5368508187e70c69ced Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 14 Nov 2003 17:49:07 +0000 Subject: [PATCH] - Remove use of Giant from uma_zone_set_obj(). --- sys/vm/uma_core.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index a821bd2c148..9b745f1f48f 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1957,8 +1957,6 @@ uma_zone_set_obj(uma_zone_t zone, struct vm_object *obj, int count) int pages; vm_offset_t kva; - mtx_lock(&Giant); - pages = count / zone->uz_ipers; if (pages * zone->uz_ipers < count) @@ -1966,10 +1964,8 @@ uma_zone_set_obj(uma_zone_t zone, struct vm_object *obj, int count) kva = kmem_alloc_pageable(kernel_map, pages * UMA_SLAB_SIZE); - if (kva == 0) { - mtx_unlock(&Giant); + if (kva == 0) return (0); - } if (obj == NULL) { obj = vm_object_allocate(OBJT_DEFAULT, pages); @@ -1985,8 +1981,6 @@ uma_zone_set_obj(uma_zone_t zone, struct vm_object *obj, int count) zone->uz_allocf = obj_alloc; zone->uz_flags |= UMA_ZONE_NOFREE | UMA_ZFLAG_PRIVALLOC; ZONE_UNLOCK(zone); - mtx_unlock(&Giant); - return (1); }