summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorBosko Milekic <bmilekic@FreeBSD.org>2001-03-24 23:47:52 +0000
committerBosko Milekic <bmilekic@FreeBSD.org>2001-03-24 23:47:52 +0000
commit2ba1a89559cf96b31212e79fe200b3b7da73cafc (patch)
tree17fc9df70ab425b13f66d311d9fee52c94dd3df8 /sys/kern
parent66ef8af5b0e00b074572e81d3ff8c0453b284325 (diff)
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_mbuf.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index b5569cd842a3..5a23f67deb8f 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -245,16 +245,8 @@ m_mballoc(int nmb, int how)
* Also, once we run out of map space, it will be impossible to
* get any more (nothing is ever freed back to the map).
*/
- if (mb_map_full || ((nmb + mbstat.m_mbufs) > nmbufs)) {
- /*
- * Needs to be atomic as we may be incrementing it
- * while holding another mutex, like mclfree. In other
- * words, m_drops is not reserved solely for mbufs,
- * but is also available for clusters.
- */
- atomic_add_long(&mbstat.m_drops, 1);
+ if (mb_map_full || ((nmb + mbstat.m_mbufs) > nmbufs))
return (0);
- }
mtx_unlock(&mmbfree.m_mtx);
p = (caddr_t)kmem_malloc(mb_map, nbytes, M_NOWAIT);
@@ -343,8 +335,7 @@ m_mballoc_wait(void)
atomic_add_long(&mbstat.m_wait, 1);
if (mmbfree.m_head != NULL)
MBWAKEUP(m_mballoc_wid);
- } else
- atomic_add_long(&mbstat.m_drops, 1);
+ }
return (p);
}
@@ -370,10 +361,8 @@ m_clalloc(int ncl, int how)
* If we've hit the mcluster number limit, stop allocating from
* mb_map.
*/
- if (mb_map_full || ((ncl + mbstat.m_clusters) > nmbclusters)) {
- atomic_add_long(&mbstat.m_drops, 1);
+ if (mb_map_full || ((ncl + mbstat.m_clusters) > nmbclusters))
return (0);
- }
mtx_unlock(&mclfree.m_mtx);
p = (caddr_t)kmem_malloc(mb_map, npg_sz,
@@ -384,10 +373,8 @@ m_clalloc(int ncl, int how)
* Either the map is now full, or `how' is M_DONTWAIT and there
* are no pages left.
*/
- if (p == NULL) {
- atomic_add_long(&mbstat.m_drops, 1);
+ if (p == NULL)
return (0);
- }
/*
* We don't let go of the mutex in order to avoid a race.
@@ -429,8 +416,7 @@ m_clalloc_wait(void)
atomic_add_long(&mbstat.m_wait, 1);
if (mclfree.m_head != NULL)
MBWAKEUP(m_clalloc_wid);
- } else
- atomic_add_long(&mbstat.m_drops, 1);
+ }
return (p);
}