summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-02-08 00:27:38 +0000
committerjhb <jhb@FreeBSD.org>2001-02-08 00:27:38 +0000
commit9b6b2fecee48ad3002c1270ff670affd7c766de9 (patch)
treed8f0b56b574f8cc2f94582aeb09b0d60c48dd838 /sys
parent269b51d4a035539f2f63332131bc9e7ba169c110 (diff)
downloadFreeBSD-src-9b6b2fecee48ad3002c1270ff670affd7c766de9.zip
FreeBSD-src-9b6b2fecee48ad3002c1270ff670affd7c766de9.tar.gz
Don't bother with acquiring/releasing Giant around kmem_malloc() and
kmem_free() for now. Kmem_malloc() and kmem_free() now have appropriate assertions in place, and these checks aren't feasible until more of the networking code is locked down. Also, the extra assertions here should already be caught by the WITNESS code as lock order violations should mutex operations on Giant be reintroduced here later.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_mbuf.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 8a984ac..1489157 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -205,25 +205,11 @@ m_alloc_ref(nmb, how)
nbytes = round_page(nmb * sizeof(union mext_refcnt));
mtx_exit(&mcntfree.m_mtx, MTX_DEF);
-#ifdef WITNESS
- /*
- * XXX: Make sure we don't create lock order problems.
- * XXX: We'll grab Giant, but for that to be OK, make sure
- * XXX: that either Giant is already held OR make sure that
- * XXX: no other locks are held coming in.
- * XXX: Revisit once most of the net stuff gets locks added.
- */
- KASSERT(mtx_owned(&Giant) || witness_list(CURPROC) == 0,
- ("m_alloc_ref: Giant must be owned or no locks held"));
-#endif
- mtx_enter(&Giant, MTX_DEF);
if ((p = (caddr_t)kmem_malloc(mb_map, nbytes, how == M_TRYWAIT ?
M_WAITOK : M_NOWAIT)) == NULL) {
- mtx_exit(&Giant, MTX_DEF);
mtx_enter(&mcntfree.m_mtx, MTX_DEF);
return (0);
}
- mtx_exit(&Giant, MTX_DEF);
nmb = nbytes / sizeof(union mext_refcnt);
/*
@@ -275,24 +261,11 @@ m_mballoc(nmb, how)
nbytes = round_page(nmb * MSIZE);
mtx_exit(&mmbfree.m_mtx, MTX_DEF);
-#ifdef WITNESS
- /*
- * XXX: Make sure we don't create lock order problems.
- * XXX: We'll grab Giant, but for that to be OK, make sure
- * XXX: that either Giant is already held OR make sure that
- * XXX: no other locks are held coming in.
- * XXX: Revisit once most of the net stuff gets locks added.
- */
- KASSERT(mtx_owned(&Giant) || witness_list(CURPROC) == 0,
- ("m_mballoc: Giant must be owned or no locks held"));
-#endif
- mtx_enter(&Giant, MTX_DEF);
p = (caddr_t)kmem_malloc(mb_map, nbytes, M_NOWAIT);
if (p == 0 && how == M_TRYWAIT) {
atomic_add_long(&mbstat.m_wait, 1);
p = (caddr_t)kmem_malloc(mb_map, nbytes, M_WAITOK);
}
- mtx_exit(&Giant, MTX_DEF);
mtx_enter(&mmbfree.m_mtx, MTX_DEF);
/*
@@ -409,21 +382,8 @@ m_clalloc(ncl, how)
npg = ncl;
mtx_exit(&mclfree.m_mtx, MTX_DEF);
-#ifdef WITNESS
- /*
- * XXX: Make sure we don't create lock order problems.
- * XXX: We'll grab Giant, but for that to be OK, make sure
- * XXX: that either Giant is already held OR make sure that
- * XXX: no other locks are held coming in.
- * XXX: Revisit once most of the net stuff gets locks added.
- */
- KASSERT(mtx_owned(&Giant) || witness_list(CURPROC) == 0,
- ("m_clalloc: Giant must be owned or no locks held"));
-#endif
- mtx_enter(&Giant, MTX_DEF);
p = (caddr_t)kmem_malloc(mb_map, ctob(npg),
how == M_TRYWAIT ? M_WAITOK : M_NOWAIT);
- mtx_exit(&Giant, MTX_DEF);
ncl = ncl * PAGE_SIZE / MCLBYTES;
mtx_enter(&mclfree.m_mtx, MTX_DEF);
OpenPOWER on IntegriCloud