svn commit: r205761 - stable/8/sys/netinet
Bjoern A. Zeeb
bz at FreeBSD.org
Sat Mar 27 17:50:03 UTC 2010
Author: bz
Date: Sat Mar 27 17:50:02 2010
New Revision: 205761
URL: http://svn.freebsd.org/changeset/base/205761
Log:
MFC r204838:
Destroy TCP UMA zones (empty or not) upon network stack teardown
to not leak them, otherwise making UMA/vmstat unhappy with every
stoped vnet.
We will still leak pages (especially for zones marked NOFREE).
Reshuffle cleanup order in tcp_destroy() to get rid of what we can
easily free first.
Reviewed by: rwatson
Modified:
stable/8/sys/netinet/tcp_reass.c
stable/8/sys/netinet/tcp_subr.c
stable/8/sys/netinet/tcp_timewait.c
stable/8/sys/netinet/tcp_var.h
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/netinet/tcp_reass.c
==============================================================================
--- stable/8/sys/netinet/tcp_reass.c Sat Mar 27 17:48:13 2010 (r205760)
+++ stable/8/sys/netinet/tcp_reass.c Sat Mar 27 17:50:02 2010 (r205761)
@@ -132,6 +132,15 @@ tcp_reass_init(void)
tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY);
}
+#ifdef VIMAGE
+void
+tcp_reass_destroy(void)
+{
+
+ uma_zdestroy(V_tcp_reass_zone);
+}
+#endif
+
int
tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
{
Modified: stable/8/sys/netinet/tcp_subr.c
==============================================================================
--- stable/8/sys/netinet/tcp_subr.c Sat Mar 27 17:48:13 2010 (r205760)
+++ stable/8/sys/netinet/tcp_subr.c Sat Mar 27 17:50:02 2010 (r205761)
@@ -445,15 +445,21 @@ void
tcp_destroy(void)
{
- tcp_tw_destroy();
+ tcp_reass_destroy();
tcp_hc_destroy();
syncache_destroy();
+ tcp_tw_destroy();
/* XXX check that hashes are empty! */
hashdestroy(V_tcbinfo.ipi_hashbase, M_PCB,
V_tcbinfo.ipi_hashmask);
hashdestroy(V_tcbinfo.ipi_porthashbase, M_PCB,
V_tcbinfo.ipi_porthashmask);
+
+ uma_zdestroy(V_sack_hole_zone);
+ uma_zdestroy(V_tcpcb_zone);
+ uma_zdestroy(V_tcbinfo.ipi_zone);
+
INP_INFO_LOCK_DESTROY(&V_tcbinfo);
}
#endif
Modified: stable/8/sys/netinet/tcp_timewait.c
==============================================================================
--- stable/8/sys/netinet/tcp_timewait.c Sat Mar 27 17:48:13 2010 (r205760)
+++ stable/8/sys/netinet/tcp_timewait.c Sat Mar 27 17:50:02 2010 (r205761)
@@ -185,6 +185,8 @@ tcp_tw_destroy(void)
while((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL)
tcp_twclose(tw, 0);
INP_INFO_WUNLOCK(&V_tcbinfo);
+
+ uma_zdestroy(V_tcptw_zone);
}
#endif
Modified: stable/8/sys/netinet/tcp_var.h
==============================================================================
--- stable/8/sys/netinet/tcp_var.h Sat Mar 27 17:48:13 2010 (r205760)
+++ stable/8/sys/netinet/tcp_var.h Sat Mar 27 17:50:02 2010 (r205761)
@@ -648,6 +648,9 @@ char *tcp_log_addrs(struct in_conninfo
const void *);
int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *);
void tcp_reass_init(void);
+#ifdef VIMAGE
+void tcp_reass_destroy(void);
+#endif
void tcp_input(struct mbuf *, int);
u_long tcp_maxmtu(struct in_conninfo *, int *);
u_long tcp_maxmtu6(struct in_conninfo *, int *);
More information about the svn-src-all
mailing list