summaryrefslogtreecommitdiffstats
path: root/sys/sys/mbuf.h
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-11-04 00:28:38 +0000
committerdg <dg@FreeBSD.org>1994-11-04 00:28:38 +0000
commite5e0a79080bc8c0bcc844b2d769845c4bdb7ce09 (patch)
treea8783447aa6df0dfbddc48f288041f76514c0183 /sys/sys/mbuf.h
parent7234eaeb650aa6ffa6fd4c8a8be7247e21feb27f (diff)
downloadFreeBSD-src-e5e0a79080bc8c0bcc844b2d769845c4bdb7ce09.zip
FreeBSD-src-e5e0a79080bc8c0bcc844b2d769845c4bdb7ce09.tar.gz
Backed out mbuf performance improvement. mbufs are allocated with various
different types, and with the 'local cache', what is freed isn't necessarily what was originally malloced. This screws malloc's statistics and type allocation limits, resulting eventually in a deadlock when one of the limits is bogusly reached. Recent performance tests on a Pentium machine indicate no improvement with this optimization anyway (this is something to be looked at further).
Diffstat (limited to 'sys/sys/mbuf.h')
-rw-r--r--sys/sys/mbuf.h36
1 files changed, 4 insertions, 32 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index f68fa77..3b23d19 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.3 (Berkeley) 1/21/94
- * $Id: mbuf.h,v 1.6 1994/10/02 17:24:50 phk Exp $
+ * $Id: mbuf.h,v 1.7 1994/10/02 20:04:04 davidg Exp $
*/
#ifndef _SYS_MBUF_H_
@@ -171,19 +171,8 @@ struct mbuf {
* allocates an mbuf and initializes it to contain a packet header
* and internal data.
*/
-struct mbuf *mbuffree;
-int mbuffreecnt;
#define MGET(m, how, type) { \
- int s = splimp(); \
- if (mbuffree == 0) { \
- splx(s); \
- MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
- } else { \
- --mbuffreecnt; \
- (m) = mbuffree; \
- mbuffree = (m)->m_next; \
- splx(s); \
- } \
+ MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
if (m) { \
(m)->m_type = (type); \
MBUFLOCK(mbstat.m_mtypes[type]++;) \
@@ -196,16 +185,7 @@ int mbuffreecnt;
}
#define MGETHDR(m, how, type) { \
- int s = splimp(); \
- if (mbuffree == 0) { \
- splx(s); \
- MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
- } else { \
- --mbuffreecnt; \
- (m) = mbuffree; \
- mbuffree = (m)->m_next; \
- splx(s); \
- } \
+ MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
if (m) { \
(m)->m_type = (type); \
MBUFLOCK(mbstat.m_mtypes[type]++;) \
@@ -289,15 +269,7 @@ union mcluster {
MCLFREE((m)->m_ext.ext_buf); \
} \
(nn) = (m)->m_next; \
- if (mbuffreecnt < 256) { \
- int s = splimp(); \
- ++mbuffreecnt; \
- (m)->m_next = mbuffree; \
- mbuffree = (m); \
- splx(s); \
- } else { \
- FREE((m), mbtypes[(m)->m_type]); \
- } \
+ FREE((m), mbtypes[(m)->m_type]); \
}
#endif
OpenPOWER on IntegriCloud