From owner-svn-src-all@FreeBSD.ORG Wed Sep 5 15:59:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F121106564A; Wed, 5 Sep 2012 15:59:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7068FC1C; Wed, 5 Sep 2012 15:59:46 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D761825D38A0; Wed, 5 Sep 2012 15:59:44 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E5EA2BE84BE; Wed, 5 Sep 2012 15:59:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 0eSabfhWI39x; Wed, 5 Sep 2012 15:59:42 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C6B83BE84BC; Wed, 5 Sep 2012 15:59:41 +0000 (UTC) Date: Wed, 5 Sep 2012 15:59:41 +0000 (UTC) From: "Bjoern A. Zeeb" To: Mikolaj Golub In-Reply-To: <201209011033.q81AXsGb094283@svn.freebsd.org> Message-ID: References: <201209011033.q81AXsGb094283@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r239983 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 15:59:50 -0000 On Sat, 1 Sep 2012, Mikolaj Golub wrote: > Author: trociny > Date: Sat Sep 1 10:33:53 2012 > New Revision: 239983 > URL: http://svn.freebsd.org/changeset/base/239983 > > Log: > MFC r239075: > > In tcp timers, check INP_DROPPED flag a little later, after > callout_deactivate(), so if INP_DROPPED is set we return with the > timer active flag cleared. > > For me this fixes negative keep timer values reported by `netstat -x' > for connections in CLOSE state. panic: Lock tcp not read locked @ /w/src/sys/netinet/tcp_timer.c:497 reproducable on the cluster. Probably wrong all the way up to HEAD? > Modified: > stable/8/sys/netinet/tcp_timer.c > Directory Properties: > stable/8/sys/ (props changed) > > Modified: stable/8/sys/netinet/tcp_timer.c > ============================================================================== > --- stable/8/sys/netinet/tcp_timer.c Sat Sep 1 10:32:40 2012 (r239982) > +++ stable/8/sys/netinet/tcp_timer.c Sat Sep 1 10:33:53 2012 (r239983) > @@ -176,13 +176,18 @@ tcp_timer_delack(void *xtp) > return; > } > INP_WLOCK(inp); > - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_delack) > - || !callout_active(&tp->t_timers->tt_delack)) { > + if (callout_pending(&tp->t_timers->tt_delack) || > + !callout_active(&tp->t_timers->tt_delack)) { > INP_WUNLOCK(inp); > CURVNET_RESTORE(); > return; > } > callout_deactivate(&tp->t_timers->tt_delack); > + if ((inp->inp_flags & INP_DROPPED) != 0) { > + INP_WUNLOCK(inp); > + CURVNET_RESTORE(); > + return; > + } > > tp->t_flags |= TF_ACKNOW; > TCPSTAT_INC(tcps_delack); > @@ -222,7 +227,7 @@ tcp_timer_2msl(void *xtp) > } > INP_WLOCK(inp); > tcp_free_sackholes(tp); > - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_2msl) || > + if (callout_pending(&tp->t_timers->tt_2msl) || > !callout_active(&tp->t_timers->tt_2msl)) { > INP_WUNLOCK(tp->t_inpcb); > INP_INFO_WUNLOCK(&V_tcbinfo); > @@ -230,6 +235,12 @@ tcp_timer_2msl(void *xtp) > return; > } > callout_deactivate(&tp->t_timers->tt_2msl); > + if ((inp->inp_flags & INP_DROPPED) != 0) { > + INP_WUNLOCK(inp); > + INP_INFO_WUNLOCK(&V_tcbinfo); > + CURVNET_RESTORE(); > + return; > + } > /* > * 2 MSL timeout in shutdown went off. If we're closed but > * still waiting for peer to close and connection has been idle > @@ -293,14 +304,20 @@ tcp_timer_keep(void *xtp) > return; > } > INP_WLOCK(inp); > - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_keep) > - || !callout_active(&tp->t_timers->tt_keep)) { > + if (callout_pending(&tp->t_timers->tt_keep) || > + !callout_active(&tp->t_timers->tt_keep)) { > INP_WUNLOCK(inp); > INP_INFO_WUNLOCK(&V_tcbinfo); > CURVNET_RESTORE(); > return; > } > callout_deactivate(&tp->t_timers->tt_keep); > + if ((inp->inp_flags & INP_DROPPED) != 0) { > + INP_WUNLOCK(inp); > + INP_INFO_WUNLOCK(&V_tcbinfo); > + CURVNET_RESTORE(); > + return; > + } > /* > * Keep-alive timer went off; send something > * or drop connection if idle for too long. > @@ -388,14 +405,20 @@ tcp_timer_persist(void *xtp) > return; > } > INP_WLOCK(inp); > - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_persist) > - || !callout_active(&tp->t_timers->tt_persist)) { > + if (callout_pending(&tp->t_timers->tt_persist) || > + !callout_active(&tp->t_timers->tt_persist)) { > INP_WUNLOCK(inp); > INP_INFO_WUNLOCK(&V_tcbinfo); > CURVNET_RESTORE(); > return; > } > callout_deactivate(&tp->t_timers->tt_persist); > + if ((inp->inp_flags & INP_DROPPED) != 0) { > + INP_WUNLOCK(inp); > + INP_INFO_WUNLOCK(&V_tcbinfo); > + CURVNET_RESTORE(); > + return; > + } > /* > * Persistance timer into zero window. > * Force a byte to be output, if possible. > @@ -461,14 +484,20 @@ tcp_timer_rexmt(void * xtp) > return; > } > INP_WLOCK(inp); > - if ((inp->inp_flags & INP_DROPPED) || callout_pending(&tp->t_timers->tt_rexmt) > - || !callout_active(&tp->t_timers->tt_rexmt)) { > + if (callout_pending(&tp->t_timers->tt_rexmt) || > + !callout_active(&tp->t_timers->tt_rexmt)) { > INP_WUNLOCK(inp); > INP_INFO_WUNLOCK(&V_tcbinfo); > CURVNET_RESTORE(); > return; > } > callout_deactivate(&tp->t_timers->tt_rexmt); > + if ((inp->inp_flags & INP_DROPPED) != 0) { > + INP_WUNLOCK(inp); > + INP_INFO_RUNLOCK(&V_tcbinfo); > + CURVNET_RESTORE(); > + return; > + } > tcp_free_sackholes(tp); > /* > * Retransmission timer went off. Message has not > -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.