Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934797AbdCVNoT (ORCPT ); Wed, 22 Mar 2017 09:44:19 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47982 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934777AbdCVNoJ (ORCPT ); Wed, 22 Mar 2017 09:44:09 -0400 Date: Wed, 22 Mar 2017 13:11:00 +0100 From: Peter Zijlstra To: Kees Cook Cc: Eric Dumazet , Herbert Xu , David Miller , "Reshetova, Elena" , Network Development , bridge@lists.linux-foundation.org, LKML , Alexey Kuznetsov , James Morris , Patrick McHardy , Stephen Hemminger , Hans Liljestrand , David Windsor , Andrew Morton Subject: Re: [PATCH 07/17] net: convert sock.sk_refcnt from atomic_t to refcount_t Message-ID: <20170322121100.cjeqno4g3s5n2qtl@hirez.programming.kicks-ass.net> References: <20170318164759.GA23837@gondor.apana.org.au> <20170318.182121.439615057765380575.davem@davemloft.net> <20170320103937.lq7nfnutupr3gkn7@hirez.programming.kicks-ass.net> <20170320131629.GA26405@gondor.apana.org.au> <20170320132357.acygo3umw6fiwb4p@hirez.programming.kicks-ass.net> <20170320132713.GA26954@gondor.apana.org.au> <20170320134017.h3c2jrsnd4guuyu7@hirez.programming.kicks-ass.net> <1490131389.16816.123.camel@edumazet-glaptop3.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1229 Lines: 29 On Tue, Mar 21, 2017 at 04:51:13PM -0700, Kees Cook wrote: > On Tue, Mar 21, 2017 at 2:23 PM, Eric Dumazet wrote: > > Unfortunately there is no good test simulating real-world workloads, > > which are mostly using TCP flows. > > Sure, but there has to be _something_ that can be used to test to > measure the effects. Without a meaningful test, it's weird to reject a > change for performance reasons. This. How can you optimize if there's no way to actually measure something? > > Most synthetic tools you can find are not using epoll(), and very often > > hit bottlenecks in other layers. > > > > > > It looks like our suggestion to get kernel builds with atomic_inc() > > being exactly an atomic_inc() is not even discussed or implemented. > > So, FWIW, I originally tried to make this a CONFIG in the first couple > passes at getting a refcount defense. I would be fine with this, but I > was not able to convince Peter. :) However, things have evolved a lot > since then, so perhaps there are things do be done here. Well, the argument was that unless there's a benchmark that shows it cares, its all premature optimization. Similarly, you wanted this enabled at all times because hardening.