svn commit: r253361 - in head/sys: i386/i386 kern sys

Gleb Smirnoff glebius at FreeBSD.org
Mon Jul 15 12:18:37 UTC 2013


Author: glebius
Date: Mon Jul 15 12:18:36 2013
New Revision: 253361
URL: http://svnweb.freebsd.org/changeset/base/253361

Log:
  Nuke mbstat. It wasn't used for mbuf statistics since FreeBSD 5.
  
  Now that r253351 moved sendfile() stats to a separate struct, the
  last field used in mbstat is m_mcfail, which is updated, but never
  read or obtained from userland.

Modified:
  head/sys/i386/i386/symbols.raw
  head/sys/kern/kern_mbuf.c
  head/sys/kern/uipc_mbuf.c
  head/sys/sys/mbuf.h

Modified: head/sys/i386/i386/symbols.raw
==============================================================================
--- head/sys/i386/i386/symbols.raw	Mon Jul 15 12:15:14 2013	(r253360)
+++ head/sys/i386/i386/symbols.raw	Mon Jul 15 12:18:36 2013	(r253361)
@@ -43,7 +43,6 @@
 	_averunnable
 	_boottime
 #netstat
-	_mbstat
 	_ipstat
 	_tcb
 	_tcpstat

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Mon Jul 15 12:15:14 2013	(r253360)
+++ head/sys/kern/kern_mbuf.c	Mon Jul 15 12:18:36 2013	(r253361)
@@ -102,7 +102,6 @@ int nmbclusters;		/* limits number of mb
 int nmbjumbop;			/* limits number of page size jumbo clusters */
 int nmbjumbo9;			/* limits number of 9k jumbo clusters */
 int nmbjumbo16;			/* limits number of 16k jumbo clusters */
-struct mbstat mbstat;
 
 static quad_t maxmbufmem;	/* overall real memory limit for all mbufs */
 
@@ -262,9 +261,6 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs,
 &nmbufs, 0, sysctl_nmbufs, "IU",
     "Maximum number of mbufs allowed");
 
-SYSCTL_STRUCT(_kern_ipc, OID_AUTO, mbstat, CTLFLAG_RD, &mbstat, mbstat,
-    "Mbuf general information and statistics");
-
 /*
  * Zones from which we allocate.
  */
@@ -384,23 +380,6 @@ mbuf_init(void *dummy)
 	 */
 	EVENTHANDLER_REGISTER(vm_lowmem, mb_reclaim, NULL,
 	    EVENTHANDLER_PRI_FIRST);
-
-	/*
-	 * [Re]set counters and local statistics knobs.
-	 * XXX Some of these should go and be replaced, but UMA stat
-	 * gathering needs to be revised.
-	 */
-	mbstat.m_mbufs = 0;
-	mbstat.m_mclusts = 0;
-	mbstat.m_drain = 0;
-	mbstat.m_msize = MSIZE;
-	mbstat.m_mclbytes = MCLBYTES;
-	mbstat.m_minclsize = MINCLSIZE;
-	mbstat.m_mlen = MLEN;
-	mbstat.m_mhlen = MHLEN;
-	mbstat.m_numtypes = MT_NTYPES;
-
-	mbstat.m_mcfail = mbstat.m_mpfail = 0;
 }
 SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL);
 

Modified: head/sys/kern/uipc_mbuf.c
==============================================================================
--- head/sys/kern/uipc_mbuf.c	Mon Jul 15 12:15:14 2013	(r253360)
+++ head/sys/kern/uipc_mbuf.c	Mon Jul 15 12:18:36 2013	(r253361)
@@ -649,13 +649,10 @@ m_copym(struct mbuf *m, int off0, int le
 		m = m->m_next;
 		np = &n->m_next;
 	}
-	if (top == NULL)
-		mbstat.m_mcfail++;	/* XXX: No consistency. */
 
 	return (top);
 nospace:
 	m_freem(top);
-	mbstat.m_mcfail++;	/* XXX: No consistency. */
 	return (NULL);
 }
 
@@ -860,7 +857,6 @@ m_copypacket(struct mbuf *m, int how)
 	return top;
 nospace:
 	m_freem(top);
-	mbstat.m_mcfail++;	/* XXX: No consistency. */ 
 	return (NULL);
 }
 
@@ -964,7 +960,6 @@ m_dup(struct mbuf *m, int how)
 
 nospace:
 	m_freem(top);
-	mbstat.m_mcfail++;	/* XXX: No consistency. */
 	return (NULL);
 }
 
@@ -1124,7 +1119,6 @@ m_pullup(struct mbuf *n, int len)
 	return (m);
 bad:
 	m_freem(n);
-	mbstat.m_mpfail++;	/* XXX: No consistency. */
 	return (NULL);
 }
 

Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h	Mon Jul 15 12:15:14 2013	(r253360)
+++ head/sys/sys/mbuf.h	Mon Jul 15 12:18:36 2013	(r253361)
@@ -317,31 +317,6 @@ struct mbuf {
 #define MB_NOTAGS	0x1UL	/* no tags attached to mbuf */
 
 /*
- * General mbuf allocator statistics structure.
- *
- * Many of these statistics are no longer used; we instead track many
- * allocator statistics through UMA's built in statistics mechanism.
- */
-struct mbstat {
-	u_long	m_mbufs;	/* XXX */
-	u_long	m_mclusts;	/* XXX */
-
-	u_long	m_drain;	/* times drained protocols for space */
-	u_long	m_mcfail;	/* XXX: times m_copym failed */
-	u_long	m_mpfail;	/* XXX: times m_pullup failed */
-	u_long	m_msize;	/* length of an mbuf */
-	u_long	m_mclbytes;	/* length of an mbuf cluster */
-	u_long	m_minclsize;	/* min length of data to allocate a cluster */
-	u_long	m_mlen;		/* length of data in an mbuf */
-	u_long	m_mhlen;	/* length of data in a header mbuf */
-
-	/* Number of mbtypes (gives # elems in mbtypes[] array) */
-	short	m_numtypes;
-
-	u_long	spare[3];
-};
-
-/*
  * Compatibility with historic mbuf allocator.
  */
 #define	MBTOM(how)	(how)
@@ -775,7 +750,6 @@ extern int		max_datalen;	/* MHLEN - max_
 extern int		max_hdr;	/* Largest link + protocol header */
 extern int		max_linkhdr;	/* Largest link-level header */
 extern int		max_protohdr;	/* Largest protocol header */
-extern struct mbstat	mbstat;		/* General mbuf stats/infos */
 extern int		nmbclusters;	/* Maximum number of clusters */
 
 struct uio;


More information about the svn-src-head mailing list