From owner-svn-src-head@freebsd.org Thu Jun 23 16:55:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BBE0B73CA9; Thu, 23 Jun 2016 16:55:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37BBA2D60; Thu, 23 Jun 2016 16:55:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 069E9B923; Thu, 23 Jun 2016 12:55:05 -0400 (EDT) From: John Baldwin To: Marko Zec Cc: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, gnn@freebsd.org, jtl@freebsd.org, gjb@freebsd.org Subject: Re: svn commit: r302099 - head/sys/netinet Date: Thu, 23 Jun 2016 09:54:35 -0700 Message-ID: <2792317.yMOeJVR7no@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160623101757.3e8022fe@x23> References: <201606230034.u5N0Y3Ea069103@repo.freebsd.org> <20160623101757.3e8022fe@x23> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 23 Jun 2016 12:55:05 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 23 Jun 2016 16:55:06 -0000 On Thursday, June 23, 2016 10:17:57 AM Marko Zec wrote: > On Thu, 23 Jun 2016 00:34:03 +0000 > "Bjoern A. Zeeb" wrote: > > > Author: bz > > Date: Thu Jun 23 00:34:03 2016 > > New Revision: 302099 > > URL: https://svnweb.freebsd.org/changeset/base/302099 > > > > Log: > > Check the V_tcbinfo.ipi_count to hit 0 before doing the full TCP > > cleanup. That way timers can finish cleanly and we do not gamble with > > a DELAY(). > > Reviewed by: gnn, jtl > > Approved by: re (gjb) > > Obtained from: projects/vnet > > MFC after: 2 weeks > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D6923 > > As much as this change is welcome, it unnecesarily introduces a > mandatory 100 ms delay on each vnet teardown, which I already pointed > out in a comment to r301601 two weeks ago, which remained unanswered, > along with the question why a delay of 100 ms was introduced here, when > before r302099 the delay was only a single clock tick? And furthermore > the delay computation expresion here is not style(9) compliant... > > Hence, please rectify the above objections, perhaps by something like: > > =================================================================== > --- tcp_subr.c (revision 302126) > +++ tcp_subr.c (working copy) > @@ -739,10 +739,11 @@ > * Sleep to let all tcpcb timers really disappear and cleanup. > */ > do { > - pause("tcpdes", hz/10); > INP_LIST_RLOCK(&V_tcbinfo); > n = V_tcbinfo.ipi_count; > INP_LIST_RUNLOCK(&V_tcbinfo); > + if (n != 0) > + pause("tcpdes", hz / 100); > } while (n != 0); > tcp_hc_destroy(); > syncache_destroy(); I would suggest avoiding the duplicate test by using a break: for (;;) { /* fetch 'n' */ if (n == 0) break; pause(...); } -- John Baldwin