From owner-freebsd-net@FreeBSD.ORG Mon Nov 3 13:36:40 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F782FFD for ; Mon, 3 Nov 2014 13:36:40 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2C8FFD for ; Mon, 3 Nov 2014 13:36:39 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id u10so846451lbd.25 for ; Mon, 03 Nov 2014 05:36:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=RQYQWGbQRfW7x6ZCam51/ADKBv16ZlFXh6ADFWZXTgA=; b=iERZpIZQD2mMWLD5bnXxrtc/9gLrSBiYWUZv1/3QwplzO/uigegn6YHu5Rg9U20xM/ sb/aWq9rXc4+5T1grSj5uIRgjnIaBEIW6Ksh72bWxpa7PcL90oTWnYZyI83h3zc6eVYG sFxxzBpurJyDzbVhqJrlgLqyhAtzxgkiGbqd6CTnMpJDRevmpGUC0N8gObCGMATcH01M eJ5VAZnEpihDnWqvhFLezTZ+yrUHfvHNLFMqJYSFLt+4mi/MSPxt3bAJo0qc9/4D+4Pd UnBVVsO2fLh3tRUvZgwveil2cWpqhnAB9tEbmXFg1n3BEiH3d58Ar94q32xMjuAPmelP F6zg== X-Gm-Message-State: ALoCoQl2nib5w+pSpMJYQV/iWtXpUkCPmPKDtoErp/bOF4jInicpu/oo8u/ODDW3GPesclkrTVxe X-Received: by 10.112.239.12 with SMTP id vo12mr51324731lbc.81.1415021367271; Mon, 03 Nov 2014 05:29:27 -0800 (PST) Received: from FRI2JCHARBON-M1.local ([217.30.88.7]) by mx.google.com with ESMTPSA id ak7sm7948249lbc.12.2014.11.03.05.29.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 05:29:26 -0800 (PST) Message-ID: <5457832D.6070709@freebsd.org> Date: Mon, 03 Nov 2014 14:29:17 +0100 From: Julien Charbon User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: Re: TCP stack lock contention with short-lived connections References: <537F39DF.1090900@verisign.com> <542EA1C9.6080907@freebsd.org> In-Reply-To: <542EA1C9.6080907@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VLXE2EJj2IFQl2Cv5JLw3s1W08jPW5rqc" Cc: "De La Gueronniere, Marc" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 13:36:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VLXE2EJj2IFQl2Cv5JLw3s1W08jPW5rqc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, On 03/10/14 15:16, Julien Charbon wrote: > On 23/05/14 14:06, Julien Charbon wrote: >> On 27/02/14 11:32, Julien Charbon wrote: >>> On 07/11/13 14:55, Julien Charbon wrote: >>>> On Mon, 04 Nov 2013 22:21:04 +0100, Julien Charbon >>>> wrote: >>>>> I have put technical and how-to-repeat details in below PR: >>>>> >>>>> kern/183659: TCP stack lock contention with short-lived connections= >>>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D183659 >>>>> >>>>> We are currently working on this performance improvement effort; = it >>>>> will impact only the TCP locking strategy not the TCP stack logic >>>>> itself. We will share on freebsd-net the patches we made for >>>>> reviewing and improvement propositions; anyway this change might a= lso >>>>> require enough eyeballs to avoid tricky race conditions introductio= n >>>>> in TCP stack. As usual, a follow-up the TCP short-lived connections performance improvement progress: Thanks to jhb (mentor/reviewer) and adrian, rpaulo, rwatson (reviewers), two related commits have been added in HEAD: - First, just a fix for a wrong ECONNRESET error on close(): A connection in TIME_WAIT state before calling close() actually did not received any RST packet https://svnweb.freebsd.org/base?view=3Drevision&revision=3D273014 - Second, a race condition fix with a code clean-up: Fix a race condition in TCP timewait between tcp_tw_2msl_reuse() and tcp_tw_2msl_scan() https://svnweb.freebsd.org/base?view=3Drevision&revision=3D273850 It means that the whole set of tcp_tw_2msl_scan()-related changes could now be MFC-ed in 10-STABLE as the KBI stability can be kept now: https://svnweb.freebsd.org/base?view=3Drevision&revision=3D264321 https://svnweb.freebsd.org/base?view=3Drevision&revision=3D264342 https://svnweb.freebsd.org/base?view=3Drevision&revision=3D264351 https://svnweb.freebsd.org/base?view=3Drevision&revision=3D264356 https://svnweb.freebsd.org/base?view=3Drevision&revision=3D273850 It also means that only one (big) related patch remains to be pushed: Introduce the INP_LIST global mutex for protecting pcbinfo global structures. Then use INP_INFO_RLOCK in critical paths to increase TCP processing scalability, and use INP_INFO_WLOCK in full INPs iteration loops. (See also joined patch). https://github.com/verisign/freebsd/commit/6e47f726f4d58f986e977fb0f816b8= a271804460 Nothing new here, just check previous emails in this thread to get all details. So far, we are adding comments and reviewing the change in more specific cases, then we plan to push this change in review around December 2014. My 2 cents. -- Julien --VLXE2EJj2IFQl2Cv5JLw3s1W08jPW5rqc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUV4M0AAoJEKVlQ5Je6dhxG+IIAJ3sAh4KnAkAmySbRnPnFV7N WtnsOTxsJLZPqtDOQI1vaJZQrS7d8JS3WftDs29LuTc6Va8iCyiXt2xFZaPjXEPy Mm1eF7nuHRpW/u/tcSzGlm+rUrXYza92g685solZKkCyIYCyAS5r4UtmD2S2ReqV U5wFYGSud3fY3/H+3cJMb9aEU1kWmHxkzsVZxSBr9LUhK+Cd8Fwy+VqLo7r1PlUb dgjtCeaOFXzjXv88/BynfyIMHzH+n/XOfJ0FaRKPs/EWYS1YIKaMhaSthNcp9ECo oVGYfXOYE6cyYGka3g6tYHY1rW6FEtRM5vYNCsbBIwwIiLyK2t4U52TfO8tjU5Y= =6plW -----END PGP SIGNATURE----- --VLXE2EJj2IFQl2Cv5JLw3s1W08jPW5rqc--