summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-01-24 00:36:03 +0000
committerjhb <jhb@FreeBSD.org>2001-01-24 00:36:03 +0000
commitfa0d2b97b0799d27897da985f1129e635785cd1e (patch)
treebd4f6a0873001c583d9491e759d43e628ade3f54
parent7c01c0a2c2233d1a835a785e4f8862fc3647c8be (diff)
downloadFreeBSD-src-fa0d2b97b0799d27897da985f1129e635785cd1e.zip
FreeBSD-src-fa0d2b97b0799d27897da985f1129e635785cd1e.tar.gz
Don't grab Giant when calling kmem_alloc/kmem_free as this is just
encouraging other people to follow the same practice. If this is going to be done, then it should be done inside of those two functions instead.
-rw-r--r--sys/kern/kern_malloc.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index ec33f61..8e13dbe 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -184,9 +184,7 @@ malloc(size, type, flags)
npg = btoc(allocsize);
mtx_exit(&malloc_mtx, MTX_DEF);
- mtx_enter(&Giant, MTX_DEF);
va = (caddr_t) kmem_malloc(kmem_map, (vm_size_t)ctob(npg), flags);
- mtx_exit(&Giant, MTX_DEF);
if (va == NULL) {
splx(s);
@@ -332,9 +330,7 @@ free(addr, type)
#endif /* INVARIANTS */
if (size > MAXALLOCSAVE) {
mtx_exit(&malloc_mtx, MTX_DEF);
- mtx_enter(&Giant, MTX_DEF);
kmem_free(kmem_map, (vm_offset_t)addr, ctob(kup->ku_pagecnt));
- mtx_exit(&Giant, MTX_DEF);
mtx_enter(&malloc_mtx, MTX_DEF);
size = kup->ku_pagecnt << PAGE_SHIFT;
OpenPOWER on IntegriCloud