From patchwork Thu Dec 15 18:53:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 88219 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp968731qgi; Thu, 15 Dec 2016 10:53:59 -0800 (PST) X-Received: by 10.98.79.193 with SMTP id f62mr3676005pfj.149.1481828039650; Thu, 15 Dec 2016 10:53:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w90si3818209pfk.54.2016.12.15.10.53.59; Thu, 15 Dec 2016 10:53:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com; dkim=pass header.i=@fb.onmicrosoft.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755219AbcLOSx4 (ORCPT + 5 others); Thu, 15 Dec 2016 13:53:56 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:58260 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753369AbcLOSxx (ORCPT ); Thu, 15 Dec 2016 13:53:53 -0500 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uBFIl742030386; Thu, 15 Dec 2016 10:53:50 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=date : from : subject : to : cc : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=ozRr3khfq9ZwJzt4o7PrlyXRQKhqcQlbfUfyOpvJ2IU=; b=UCGmgsNKBYCIeK0v0BpfNkeJB0+y8/HZeCXJrwgOH/w75puGzjaWJU1md8mGPQ2vB7F0 CHpvylooJl+UWMC05hEHlL0jo4hWvW3jcq5+ONDpMwxE2nJawttxJmnUEBCqnte7EyWn wxwAUcQPKmPxTDZ49uVUfZgpNBvh1kTD8Aw= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 27bdne4m01-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 15 Dec 2016 10:53:50 -0800 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.17) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 15 Dec 2016 10:53:48 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4CR+iPHT5AYuhGhzFZ0vLYWkBuN2ExO0SJq31zqT9xs=; b=IMCX9jpndG35AG683rdzUOc/cMVjnz6qAfTklR6FuKpRJhggN1rNvMLOFw6VeQn9i7heRBnSCVN09VY8GGdEcGJt1V3FCoPl9l2ldrB94v/4d0jStyUekTdTlLw1MKnr6jY4N6cgwVoQyCaYk9C72zkI+m76xm7tIlvssZQIxOs= Received: from localhost.localdomain (2620:10d:c091:180::945a) by BN6PR15MB1316.namprd15.prod.outlook.com (10.172.206.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Thu, 15 Dec 2016 18:53:43 +0000 Date: Thu, 15 Dec 2016 13:53:36 -0500 From: Josef Bacik Subject: Re: Soft lockup in inet_put_port on 4.6 To: Tom Herbert CC: Craig Gallek , Hannes Frederic Sowa , Eric Dumazet , "Linux Kernel Network Developers" Message-ID: <1481828016.24490.5@smtp.office365.com> In-Reply-To: References: <1481231024.1911284.813071977.72AF4DEE@webmail.messagingengine.com> <1481233016.11849.1@smtp.office365.com> <1481243432.4930.145.camel@edumazet-glaptop3.roam.corp.google.com> <6C6EE0ED-7E78-4866-8AAF-D75FD4719EF3@fb.com> <1481335192.3663.0@smtp.office365.com> <1481341624.4930.204.camel@edumazet-glaptop3.roam.corp.google.com> <1481343298.4930.208.camel@edumazet-glaptop3.roam.corp.google.com> <1481565929.24490.0@smtp.office365.com> <3c022731-e703-34ac-55f1-60f5b94b6d62@stressinduktion.org> <1481581466.24490.2@smtp.office365.com> X-Mailer: geary/0.11.2 MIME-Version: 1.0 X-Originating-IP: [2620:10d:c091:180::945a] X-ClientProxiedBy: DM5PR17CA0023.namprd17.prod.outlook.com (10.168.112.161) To BN6PR15MB1316.namprd15.prod.outlook.com (10.172.206.142) X-MS-Office365-Filtering-Correlation-Id: 62ced903-a117-436c-d872-08d4251bb222 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR15MB1316; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1316; 3:i+5p78Qf5rREReT6LGh8eOVFViO/2KrPOYOnqXPoLe1d89HHNEj2wt00jm3YCAKY/S1nXS7qkfh2sVmtjKB8oeih5qx7sUyZd/ZbbW8YbI6Kzl3RsaG6y9FPiAhRjUCP/t6jvDIvEgaZgCV2JgTFdF3TH9k7NYVKu4D8MQ4RrCYZvnaUitMCa/sCsfulsCiu9SWAPHs40HXbPhbLYMXpAv8U1WxxqptpF85/8Ek7BblfJhpYjb38Vh/yCr5JPpb9jO5hsKbYIkW9gAjQxdOQLA==; 25:CR+EOMlAbLL9lucnMz4oKDXv/7GqUJ87q65jCcABTMqaA2srMwEIt42z2PsM9C2MqtKa0ndGgYQzRct9IITupYgIyvmvJmRSNJKGM72fPtF0UoTa1F0540Y/kGTwqTs/E16NWjJu8aQgYbiQsYO4yEbsy/uUwyXbHZ5k6mEKVIHx8w8dnmX/KbwemapCCMrkCR3HRZQ6sz9rb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HJBIYgKfkxDgKO5MtRDRRZNeSYEog7r/XC17xMmiIjUKFxYlIJG+ttApztnh2VEaqs0WgZDWcVq27/EebBODtqBVEksyI9MBUzo6lo6OEzZCDhM1rQ4J6ysSNO+A83QHw1B3OdrjpugB1g8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123564025)(20161123558021)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:BN6PR15MB1316; BCL:0; PCL:0; RULEID:; SRVR:BN6PR15MB1316; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1316; 4:5Ppt3mhEzZPhrLI3Z6bt3kk00/JCJdbYn1BLZPt7u7xkfV/jSDnHV15J9og3c5uroTEP4VzDJHDzsjs0ZozcE3ep9MGi5VAxy/csNR1eWtesru2PeTpzO7a8iCO/p4XZEv2BeEoBapD6SEupXZshzijdIkKba2dz6UFS1MYj4/FGYtrPivYC6Zg2FiWvpo8ZmhERNxgFWA43kyjvtYD1pTRq1iRjWQvje6ZmtnSh0sNg+kwJ+oQhmisNiMuNSKXaOpDi5B8XZn/TtpuQ0TVDQlP3+cZnzdgWohYxO/NwjReaXe0KKSC/kKTI3SRHRYqopQwr8tu8FWdbXX7BLMTL/TBzN/M3IihgerVB8sL6p4XHJqNRXs4+czqFw7N4ZDnq3ZXaGAMT7Um6jUgi0EoXywJYjAI2KH2ek9pImz583V6378/qE0vK55Tgixqc+IO1R6ajPU2vF4Ix42IsA6x6lghq79EyP2KD8sI30LV0d0736p8L02S6nGjOuCQUiAkRYmatgEyCbM6yCIkoYCg+/ZKj3eJSnmezzvOTQ8XbPy/+1PTQvMeF5o+l4OGN+0DzRzywb0dab0gqavesiAP9tOgTuI9iVxdcij1UUhW05qWPyTvJqLNk/mwoQ6qoDd94 X-Forefront-PRVS: 0157DEB61B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(39850400002)(39410400002)(39840400002)(199003)(24454002)(57704003)(189002)(377454003)(54094003)(229853002)(8676002)(5660300001)(189998001)(38730400001)(86362001)(9686002)(97736004)(2950100002)(305945005)(101416001)(6916009)(568964002)(575784001)(5890100001)(4610100001)(4810100001)(7736002)(50226002)(93886004)(68736007)(110136003)(84326002)(6666003)(512874002)(39060400001)(88526003)(81166006)(42186005)(76176999)(6512006)(81156014)(4326007)(2906002)(105586002)(106356001)(21480400002)(6486002)(2476003)(6506006)(6116002)(92566002)(25786008)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR15MB1316; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR15MB1316; 23:6pYFmIBRWU4ZNNgCmOljGpfRc3BhGh7vbnDCoTYjp?= =?us-ascii?Q?23ouaJmNGdF/paHiXKYMeZJp6pxZb3RRmGi7o8gvao/JqC0k8x/uvn0SAPfw?= =?us-ascii?Q?DQJvgLm0boI1IgwKjo6T2aD/r5S0uDc7pLSoSzNwLIPGegtEpZceNlM0NqJs?= =?us-ascii?Q?mg1oI50rePl/XKd7ABz6n35slaBwq1/jrQ4pUmxUbxyHBVEw46XmqLhy6gkB?= =?us-ascii?Q?5k09bo349Dv28e9mAwSGZKvy1L9W41bZuSZUNnnWeaMesJ7+MlEl4Sevlfg3?= =?us-ascii?Q?coqdIbNEUAdLex7Etr24Gi0h13RzkqifDB3QY2zKf8vj+I+FnjlEwE4kPGrU?= =?us-ascii?Q?rXcleRtzNbM+nzvyfmeYth8LaxE5IoA2vk4HPtY208LY4anAK+eYOmbZTcOt?= =?us-ascii?Q?BX51maw4h+h3Nm1oR8lPpX4uJwJn0t9jFPoCmMBzIGMXLDx3UtWGjg32TkaP?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mp5CueYge8nGcrfvJ/ESee4KM+ES3b+W4jcCxX02TGjjyw7VrZcfB1wTpAr6oLSNZT9F16yKUfT5fJxVhzJCUjsth/x2zEl5BdNBgmfBqY0ty6EjrQa7ic1LsQqZtonNDszdrq8acn8n7EWq0UrStjgekHRpYTEAsHqSb2EPgR+FxkCFpQ/9d3crX77fQ0VnK/uOCJV1BiRWTCkcbtds+q21gGWOSJ9TCoK/cwpVxhCtrcJBqorq9aTYAFJpxXkLiowFh6jcFys6Pdb/VBD8fLoJ00hwDzQy02BKgza9gI5ps6zoTtuYxLr+C3QpzWM8EE+GZrY/j+kE61QJRG5Ce6A==; 20:lssgRCaXvPYQ25P1QUuL4sA5FX/nzrmtyHwcjjPi1cqqRWul+7/XVSEuEHO7R9X7EbSe9ykuUeIkHrbzLmzG26KBoq+3fpNsNDWRMmVPIIRkLixhfunHxeh5x4dTSGlANAFvffIBjCZOpyxxY/Bxlpi+5jawCSe2OJjryIunxI4= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2016 18:53:43.1750 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1316 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-15_14:, , signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Dec 13, 2016 at 6:32 PM, Tom Herbert wrote: > On Tue, Dec 13, 2016 at 3:03 PM, Craig Gallek > wrote: >> On Tue, Dec 13, 2016 at 3:51 PM, Tom Herbert >> wrote: >>> I think there may be some suspicious code in inet_csk_get_port. At >>> tb_found there is: >>> >>> if (((tb->fastreuse > 0 && reuse) || >>> (tb->fastreuseport > 0 && >>> !rcu_access_pointer(sk->sk_reuseport_cb) && >>> sk->sk_reuseport && uid_eq(tb->fastuid, >>> uid))) && >>> smallest_size == -1) >>> goto success; >>> if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk, >>> tb, true)) { >>> if ((reuse || >>> (tb->fastreuseport > 0 && >>> sk->sk_reuseport && >>> >>> !rcu_access_pointer(sk->sk_reuseport_cb) && >>> uid_eq(tb->fastuid, uid))) && >>> smallest_size != -1 && --attempts >= >>> 0) { >>> spin_unlock_bh(&head->lock); >>> goto again; >>> } >>> goto fail_unlock; >>> } >>> >>> AFAICT there is redundancy in these two conditionals. The same >>> clause >>> is being checked in both: (tb->fastreuseport > 0 && >>> !rcu_access_pointer(sk->sk_reuseport_cb) && sk->sk_reuseport && >>> uid_eq(tb->fastuid, uid))) && smallest_size == -1. If this is true >>> the >>> first conditional should be hit, goto done, and the second will >>> never >>> evaluate that part to true-- unless the sk is changed (do we need >>> READ_ONCE for sk->sk_reuseport_cb?). >> That's an interesting point... It looks like this function also >> changed in 4.6 from using a single local_bh_disable() at the >> beginning >> with several spin_lock(&head->lock) to exclusively >> spin_lock_bh(&head->lock) at each locking point. Perhaps the full >> bh >> disable variant was preventing the timers in your stack trace from >> running interleaved with this function before? > > Could be, although dropping the lock shouldn't be able to affect the > search state. TBH, I'm a little lost in reading function, the > SO_REUSEPORT handling is pretty complicated. For instance, > rcu_access_pointer(sk->sk_reuseport_cb) is checked three times in that > function and also in every call to inet_csk_bind_conflict. I wonder if > we can simply this under the assumption that SO_REUSEPORT is only > allowed if the port number (snum) is explicitly specified. Ok first I have data for you Hannes, here's the time distributions before during and after the lockup (with all the debugging in place the box eventually recovers). I've attached it as a text file since it is long. Second is I was thinking about why we would spend so much time doing the ->owners list, and obviously it's because of the massive amount of timewait sockets on the owners list. I wrote the following dumb patch and tested it and the problem has disappeared completely. Now I don't know if this is right at all, but I thought it was weird we weren't copying the soreuseport option from the original socket onto the twsk. Is there are reason we aren't doing this currently? Does this help explain what is happening? Thanks, Josef inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 4 |* | 2048 -> 4095 : 100 |****************************************| 4096 -> 8191 : 64 |************************* | 8192 -> 16383 : 35 |************** | 16384 -> 32767 : 2 | | inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 1 |* | 2048 -> 4095 : 38 |****************************************| 4096 -> 8191 : 9 |********* | 8192 -> 16383 : 2 |** | 16384 -> 32767 : 1 |* | inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 9 |** | 2048 -> 4095 : 54 |**************** | 4096 -> 8191 : 15 |**** | 8192 -> 16383 : 0 | | 16384 -> 32767 : 1 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 130 |****************************************| 4194304 -> 8388607 : 0 | | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 0 | | 33554432 -> 67108863 : 92 |**************************** | inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 11 | | 2048 -> 4095 : 132 |********* | 4096 -> 8191 : 91 |****** | 8192 -> 16383 : 13 | | 16384 -> 32767 : 0 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 401 |**************************** | 4194304 -> 8388607 : 274 |******************* | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 16 |* | 33554432 -> 67108863 : 561 |****************************************| inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 6 | | 2048 -> 4095 : 68 |**** | 4096 -> 8191 : 9 | | 8192 -> 16383 : 2 | | 16384 -> 32767 : 0 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 650 |****************************************| 4194304 -> 8388607 : 0 | | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 15 | | 33554432 -> 67108863 : 583 |*********************************** | inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 18 |* | 2048 -> 4095 : 263 |******************** | 4096 -> 8191 : 188 |************** | 8192 -> 16383 : 186 |************** | 16384 -> 32767 : 7 | | 32768 -> 65535 : 1 | | 65536 -> 131071 : 1 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 37 |** | 4194304 -> 8388607 : 454 |********************************** | 8388608 -> 16777215 : 9 | | 16777216 -> 33554431 : 24 |* | 33554432 -> 67108863 : 526 |****************************************| inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 20 |* | 2048 -> 4095 : 130 |********** | 4096 -> 8191 : 40 |*** | 8192 -> 16383 : 2 | | 16384 -> 32767 : 1 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 506 |*************************************** | 4194304 -> 8388607 : 0 | | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 23 |* | 33554432 -> 67108863 : 511 |****************************************| inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 9 | | 2048 -> 4095 : 356 |********************| 4096 -> 8191 : 230 |************ | 8192 -> 16383 : 342 |******************* | 16384 -> 32767 : 12 | | 32768 -> 65535 : 1 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 1 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 311 |***************** | 4194304 -> 8388607 : 163 |********* | 8388608 -> 16777215 : 1 | | 16777216 -> 33554431 : 3 | | 33554432 -> 67108863 : 338 |****************** | 67108864 -> 134217727 : 55 |*** | 134217728 -> 268435455 : 65 |*** | 268435456 -> 536870911 : 36 |** | 536870912 -> 1073741823 : 22 |* | 1073741824 -> 2147483647 : 16 | | 2147483648 -> 4294967295 : 7 | | 4294967296 -> 8589934591 : 1 | | inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 2 | | 2048 -> 4095 : 86 |*** | 4096 -> 8191 : 16 | | 8192 -> 16383 : 0 | | 16384 -> 32767 : 0 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 187 |******* | 2097152 -> 4194303 : 975 |****************************************| 4194304 -> 8388607 : 0 | | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 337 |************* | 33554432 -> 67108863 : 442 |****************** | inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 162 |**** | 2048 -> 4095 : 495 |************** | 4096 -> 8191 : 66 |* | 8192 -> 16383 : 6 | | 16384 -> 32767 : 2 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 680 |********************| 4194304 -> 8388607 : 166 |**** | 8388608 -> 16777215 : 10 | | 16777216 -> 33554431 : 6 | | 33554432 -> 67108863 : 150 |**** | 67108864 -> 134217727 : 275 |******** | 134217728 -> 268435455 : 205 |****** | 268435456 -> 536870911 : 151 |**** | 536870912 -> 1073741823 : 137 |**** | 1073741824 -> 2147483647 : 76 |** | 2147483648 -> 4294967295 : 48 |* | 4294967296 -> 8589934591 : 6 | | 8589934592 -> 17179869183 : 2 | | inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 7 | | 2048 -> 4095 : 40 |*** | 4096 -> 8191 : 0 | | 8192 -> 16383 : 0 | | 16384 -> 32767 : 0 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 33 |** | 2097152 -> 4194303 : 159 |************ | 4194304 -> 8388607 : 0 | | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 311 |************************* | 33554432 -> 67108863 : 493 |****************************************| inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 129 |******************* | 2048 -> 4095 : 55 |******** | 4096 -> 8191 : 47 |******* | 8192 -> 16383 : 17 |** | 16384 -> 32767 : 2 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 30 |**** | 2097152 -> 4194303 : 130 |********************| 4194304 -> 8388607 : 24 |*** | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 13 |** | 33554432 -> 67108863 : 118 |****************** | 67108864 -> 134217727 : 58 |******** | 134217728 -> 268435455 : 17 |** | 268435456 -> 536870911 : 7 |* | 536870912 -> 1073741823 : 0 | | 1073741824 -> 2147483647 : 1 | | 2147483648 -> 4294967295 : 0 | | 4294967296 -> 8589934591 : 1 | | inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 6 |* | 2048 -> 4095 : 14 |** | 4096 -> 8191 : 0 | | 8192 -> 16383 : 1 | | 16384 -> 32767 : 0 | | 32768 -> 65535 : 0 | | 65536 -> 131071 : 0 | | 131072 -> 262143 : 0 | | 262144 -> 524287 : 0 | | 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 158 |******************************** | 2097152 -> 4194303 : 22 |**** | 4194304 -> 8388607 : 0 | | 8388608 -> 16777215 : 0 | | 16777216 -> 33554431 : 192 |****************************************| 33554432 -> 67108863 : 9 |* | inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 10 |**************** | 2048 -> 4095 : 25 |****************************************| 4096 -> 8191 : 16 |************************* | 8192 -> 16383 : 1 |* | 16384 -> 32767 : 0 | | 32768 -> 65535 : 1 |* | inet_csk_bind_conflict : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 10 |********************************* | 2048 -> 4095 : 12 |****************************************| inet_csk_get_port : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 0 | | 2048 -> 4095 : 0 | | 4096 -> 8191 : 4 |****************************************| 8192 -> 16383 : 1 |********** | commit ea66f43c5b4d94625ad7322e4097acd9a06d7fdd Author: Josef Bacik Date: Wed Dec 14 11:54:49 2016 -0800 do reuseport too diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index c9b3eb7..567017b 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h @@ -55,6 +55,7 @@ struct inet_timewait_sock { #define tw_family __tw_common.skc_family #define tw_state __tw_common.skc_state #define tw_reuse __tw_common.skc_reuse +#define tw_reuseport __tw_common.skc_reuseport #define tw_ipv6only __tw_common.skc_ipv6only #define tw_bound_dev_if __tw_common.skc_bound_dev_if #define tw_node __tw_common.skc_nulls_node diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index a1b1057..04c560e 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c @@ -183,6 +183,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, tw->tw_dport = inet->inet_dport; tw->tw_family = sk->sk_family; tw->tw_reuse = sk->sk_reuse; + tw->tw_reuseport = sk->sk_reuseport; tw->tw_hash = sk->sk_hash; tw->tw_ipv6only = 0; tw->tw_transparent = inet->transparent;