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.
This commit is contained in:
parent
2898a92a21
commit
59b9c4f289
@ -43,7 +43,6 @@
|
|||||||
_averunnable
|
_averunnable
|
||||||
_boottime
|
_boottime
|
||||||
#netstat
|
#netstat
|
||||||
_mbstat
|
|
||||||
_ipstat
|
_ipstat
|
||||||
_tcb
|
_tcb
|
||||||
_tcpstat
|
_tcpstat
|
||||||
|
@ -102,7 +102,6 @@ int nmbclusters; /* limits number of mbuf clusters */
|
|||||||
int nmbjumbop; /* limits number of page size jumbo clusters */
|
int nmbjumbop; /* limits number of page size jumbo clusters */
|
||||||
int nmbjumbo9; /* limits number of 9k jumbo clusters */
|
int nmbjumbo9; /* limits number of 9k jumbo clusters */
|
||||||
int nmbjumbo16; /* limits number of 16k jumbo clusters */
|
int nmbjumbo16; /* limits number of 16k jumbo clusters */
|
||||||
struct mbstat mbstat;
|
|
||||||
|
|
||||||
static quad_t maxmbufmem; /* overall real memory limit for all mbufs */
|
static quad_t maxmbufmem; /* overall real memory limit for all mbufs */
|
||||||
|
|
||||||
@ -262,9 +261,6 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, CTLTYPE_INT|CTLFLAG_RW,
|
|||||||
&nmbufs, 0, sysctl_nmbufs, "IU",
|
&nmbufs, 0, sysctl_nmbufs, "IU",
|
||||||
"Maximum number of mbufs allowed");
|
"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.
|
* Zones from which we allocate.
|
||||||
*/
|
*/
|
||||||
@ -384,23 +380,6 @@ mbuf_init(void *dummy)
|
|||||||
*/
|
*/
|
||||||
EVENTHANDLER_REGISTER(vm_lowmem, mb_reclaim, NULL,
|
EVENTHANDLER_REGISTER(vm_lowmem, mb_reclaim, NULL,
|
||||||
EVENTHANDLER_PRI_FIRST);
|
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);
|
SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbuf_init, NULL);
|
||||||
|
|
||||||
|
@ -649,13 +649,10 @@ m_copym(struct mbuf *m, int off0, int len, int wait)
|
|||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
np = &n->m_next;
|
np = &n->m_next;
|
||||||
}
|
}
|
||||||
if (top == NULL)
|
|
||||||
mbstat.m_mcfail++; /* XXX: No consistency. */
|
|
||||||
|
|
||||||
return (top);
|
return (top);
|
||||||
nospace:
|
nospace:
|
||||||
m_freem(top);
|
m_freem(top);
|
||||||
mbstat.m_mcfail++; /* XXX: No consistency. */
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -860,7 +857,6 @@ m_copypacket(struct mbuf *m, int how)
|
|||||||
return top;
|
return top;
|
||||||
nospace:
|
nospace:
|
||||||
m_freem(top);
|
m_freem(top);
|
||||||
mbstat.m_mcfail++; /* XXX: No consistency. */
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -964,7 +960,6 @@ m_dup(struct mbuf *m, int how)
|
|||||||
|
|
||||||
nospace:
|
nospace:
|
||||||
m_freem(top);
|
m_freem(top);
|
||||||
mbstat.m_mcfail++; /* XXX: No consistency. */
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1124,7 +1119,6 @@ m_pullup(struct mbuf *n, int len)
|
|||||||
return (m);
|
return (m);
|
||||||
bad:
|
bad:
|
||||||
m_freem(n);
|
m_freem(n);
|
||||||
mbstat.m_mpfail++; /* XXX: No consistency. */
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,31 +316,6 @@ struct mbuf {
|
|||||||
|
|
||||||
#define MB_NOTAGS 0x1UL /* no tags attached to 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.
|
* Compatibility with historic mbuf allocator.
|
||||||
*/
|
*/
|
||||||
@ -775,7 +750,6 @@ extern int max_datalen; /* MHLEN - max_hdr */
|
|||||||
extern int max_hdr; /* Largest link + protocol header */
|
extern int max_hdr; /* Largest link + protocol header */
|
||||||
extern int max_linkhdr; /* Largest link-level header */
|
extern int max_linkhdr; /* Largest link-level header */
|
||||||
extern int max_protohdr; /* Largest protocol header */
|
extern int max_protohdr; /* Largest protocol header */
|
||||||
extern struct mbstat mbstat; /* General mbuf stats/infos */
|
|
||||||
extern int nmbclusters; /* Maximum number of clusters */
|
extern int nmbclusters; /* Maximum number of clusters */
|
||||||
|
|
||||||
struct uio;
|
struct uio;
|
||||||
|
Loading…
Reference in New Issue
Block a user