From owner-svn-src-head@FreeBSD.ORG Sun Mar 7 15:58:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B19C106566B; Sun, 7 Mar 2010 15:58:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FDC88FC0C; Sun, 7 Mar 2010 15:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27FwjsZ093632; Sun, 7 Mar 2010 15:58:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27Fwjxq093626; Sun, 7 Mar 2010 15:58:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201003071558.o27Fwjxq093626@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 7 Mar 2010 15:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204838 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2010 15:58:45 -0000 Author: bz Date: Sun Mar 7 15:58:44 2010 New Revision: 204838 URL: http://svn.freebsd.org/changeset/base/204838 Log: 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. Sponsored by: ISPsystem Reviewed by: rwatson MFC after: 5 days Modified: head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sun Mar 7 15:37:58 2010 (r204837) +++ head/sys/netinet/tcp_reass.c Sun Mar 7 15:58:44 2010 (r204838) @@ -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: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Mar 7 15:37:58 2010 (r204837) +++ head/sys/netinet/tcp_subr.c Sun Mar 7 15:58:44 2010 (r204838) @@ -459,15 +459,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: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sun Mar 7 15:37:58 2010 (r204837) +++ head/sys/netinet/tcp_timewait.c Sun Mar 7 15:58:44 2010 (r204838) @@ -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: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Mar 7 15:37:58 2010 (r204837) +++ head/sys/netinet/tcp_var.h Sun Mar 7 15:58:44 2010 (r204838) @@ -657,6 +657,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 *);