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).
This commit is contained in:
David Greenman 1994-11-04 00:28:38 +00:00
parent e4aaba56f5
commit fb21f2fe90
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4130

View File

@ -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