Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1310360imm; Thu, 6 Sep 2018 20:35:12 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb8ylewrj9pUJuVe1oKvqSfaGmdZJ/kzsOS8CYTNNaIdDCqn0mvMy5kRmw/u9kdggNm6oxH X-Received: by 2002:a63:9409:: with SMTP id m9-v6mr6103333pge.13.1536291311980; Thu, 06 Sep 2018 20:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536291311; cv=none; d=google.com; s=arc-20160816; b=n2UgHLBd+mTIj6vKW1YcH4XAvmdoc26v9+l8TF94WF7VV0PXJPhZZmRzFv3VuetavE H/3ESe98jYkoS51SE7o0rBnMnRzFWKlKRUkijmvh5u8e3yGk//ru8AMJNhCtoaHjI8b3 1XUMdak/8ukVlbbmZ5+T+n6CLXVmueh+VXfTcq7JT3pJ9y9TamkdmPzEYKPUCf036qvL 9Kpi70p0uiYQRODk7VOlhlhP1H7wfeHMrxMOnEO8MTFAXo//8lHrZFyAyPMmWvMxmutJ bPIe4NL25hKLXhdsxA3jySmMdCJkTjH6Fi0pMzVXJ0P+IfCsftsMNkpVQYimELJ6bcw2 S23w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8YrwIfgz1tDp96z0nB2Cd17JtTuk+po1fC2xZi7jWtQ=; b=NQ1G6JugEKjNQko5tpJuTQu3/MPuZERPIFyN/mJ6Q0h6j7TrikxC0In2AjXaJ7Omhv NSxoQUWihUzLN5PtuKHt2VBLBYrR6HoLnCRJcIOQQ6yU59SBTY/NQn7NiCVZ0mWEOUUo 5csTnXu2XYO1MVwge6hkcPGdK9ecB+wvcOajW24mrIWnkx6b2tX8xpKBvDJ8s/t0T14L 19bp/TsPu2ItyCCt/lYwnbpm9TGacd3Y66fdF80S/h0HsWEbZxFUjuw7mTLR6/beHiD5 cONPLwd6VNm2dzizvtfysKEDwcDWSssXmBxs3jRnee6CarO5/28edzeWEC3O7EyFwdYO U69g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y13-v6si6600703pgp.560.2018.09.06.20.34.56; Thu, 06 Sep 2018 20:35:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727181AbeIGIMh (ORCPT + 99 others); Fri, 7 Sep 2018 04:12:37 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:44486 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbeIGIMh (ORCPT ); Fri, 7 Sep 2018 04:12:37 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1fy7W7-00056k-W3; Fri, 07 Sep 2018 11:33:08 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fy7Vx-0000ev-Ae; Fri, 07 Sep 2018 11:32:57 +0800 Date: Fri, 7 Sep 2018 11:32:57 +0800 From: Herbert Xu To: Eric Dumazet Cc: Olof Johansson , David Miller , Neil Horman , Marcelo Ricardo Leitner , Vladislav Yasevich , Alexey Kuznetsov , Hideaki YOSHIFUJI , linux-crypto@vger.kernel.org, LKML , linux-sctp@vger.kernel.org, netdev , linux-decnet-user@lists.sourceforge.net, kernel-team Subject: Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables Message-ID: <20180907033257.2nlgiqm2t4jiwhzc@gondor.apana.org.au> References: <20180906192034.8467-1-olof@lixom.net> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2018 at 12:33:58PM -0700, Eric Dumazet wrote: > On Thu, Sep 6, 2018 at 12:21 PM Olof Johansson wrote: > > > > Today these are all global shared variables per protocol, and in > > particular tcp_memory_allocated can get hot on a system with > > large number of CPUs and a substantial number of connections. > > > > Moving it over to a per-cpu variable makes it significantly cheaper, > > and the added overhead when summing up the percpu copies is still smaller > > than the cost of having a hot cacheline bouncing around. > > I am curious. We never noticed contention on this variable, at least for TCP. Yes these variables are heavily amortised so I'm surprised that they would cause much contention. > Please share some numbers with us. Indeed. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt