Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1037637imm; Thu, 6 Sep 2018 14:18:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbwUXsMRjR7DT+BaqNgmg+rC4fJ8pmGiNHMr2xjLKElUMqpUFPf9strpiwGaQthDq3uPcXF X-Received: by 2002:a63:2701:: with SMTP id n1-v6mr4918137pgn.146.1536268726849; Thu, 06 Sep 2018 14:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536268726; cv=none; d=google.com; s=arc-20160816; b=XDzK1jttlGYgxzwlw+rH+jGwVNK5hTZ/VyfpWJR5/xfQo11EtHs6/uyuLc3pk+enHi j6Og/XpJwKRChoU7pj5aWRZrsxP5+guFqnJIhoDwTGV+ZSggfr9z+reGwUMcQ24mKIgG bnVokcxb7sLKg7xOgkLjxkxduSmfKv8eY32cHUITsM+eZQwRH1woI8BWfdw5jK6tZlEP uFH3S03GHIuVtsfatz8Fq0dARTAYWy/8LwH8FMvVG9vjRkmrdI9yJLdScd5qh0weS25n gUEviGHkWPVUy3dNcVS/aZ8tfbLTfRWktf510jptRUuVYJg7nrLBlbK/fiMwMG3PXceW 3zJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9yc7I4G5vbLVhFRZe4S7B81LJCOZmusl0uzsPEddW50=; b=05zTq4fTrhvdvN6HquoOj0u0A20LKURxt0raUakaVOkymWzCF4FpIGRgLy/rjt5tOt sJxH1q6wDEzOBFzzyn8bxcWDBazplMKxYozRNcyIL7Qdpo5I8x34Sm/WV1BYXNnDWElk sp+mLn2lKgLbl7aSytedsipsPBmykqXSNRVVpl2Cj0XgQmBSU5+ubWhAShcECKfoa0W0 dpLd5s7QSTkM2JB0cjMZfbwGqyRSnQ37Oi4qX17BI0w5dNRLVPhwIBMjoRz8ZQrselHI 0vw7PyqkXA0IH3CB+BNLoiLNFVGbBXUIjgpV0wS3IrIqs5eBZLNO+zZlVRD5NyRP+L2c KUWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cQWrCf+r; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15-v6si6161825pli.194.2018.09.06.14.18.31; Thu, 06 Sep 2018 14:18:46 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=cQWrCf+r; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728669AbeIGALJ (ORCPT + 99 others); Thu, 6 Sep 2018 20:11:09 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:36382 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727597AbeIGALJ (ORCPT ); Thu, 6 Sep 2018 20:11:09 -0400 Received: by mail-it0-f67.google.com with SMTP id u13-v6so16529946iti.1 for ; Thu, 06 Sep 2018 12:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9yc7I4G5vbLVhFRZe4S7B81LJCOZmusl0uzsPEddW50=; b=cQWrCf+r3Zx7SvEh3KCfAt/hLaSnwz7Yn1pd7gjdX0R0AH8Xwwg+VzTSnd9RkQ78pg CgfiJTMq3PWeqeE1NdfJwDtTHFRJLqDvSOfb2dcAlGnE3HersWKn8TtilOnW0sh5UWEC eH0zMjXcCTwW/UdSX8AzSeqCX8HHopRrD8a8GO9GPNXZY/QPkhsC9uPKPjAlUXhLABUW 53GZQYScRJOteDBdEtl5E7PwmyHlApgyWKACgjeIdqyVJzh+l1d8B+/TuCEFxc31c22e XQAzv9ASbns6fINufSTmAD+JFgmvVq+dkazD7j204aM8Dp5INr8BO/000Da2/cBG66We XDdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9yc7I4G5vbLVhFRZe4S7B81LJCOZmusl0uzsPEddW50=; b=lXT4FEIvkPkYIOCY/DL849D4QPQRgA1yCM4M2pbXtz8DiFbcUC/Num+LY1IwNbsh3R 6xSvQacYouY27gR7V1uPOPgA3rA3M7DHdNk4oIjdeI0qymqxN6IHoueUZvdLhFPLjvh0 M8E9E6cJjKibH0bVoBuRTqQ2ha5qksfC9GRhXW84dw9w75bahnF2NnGGOwNsajSt2WyV GOVbcdthlPkZHnBTXtWCXJI4bRlC/j2fwSasTgcKpXJXnPi67HGWYc15qtYJ55aPd9xY IvWUz220WYT5JFdyGCuVsclxTVar80Db6C/3hQOrHEowvPfnMOswu7xv4uNQcr1EEpiv w4Vg== X-Gm-Message-State: APzg51BObWxPhOV396PfVVqnkA6rqXEzX7a96vIg4Co95ij5ZNKpS+10 0AkCi+/aODWeR3cm0YYqDyxy/pbd66k6X/IGUsbIkw== X-Received: by 2002:a02:c4c6:: with SMTP id h6-v6mr3643136jaj.26.1536262451541; Thu, 06 Sep 2018 12:34:11 -0700 (PDT) MIME-Version: 1.0 References: <20180906192034.8467-1-olof@lixom.net> In-Reply-To: <20180906192034.8467-1-olof@lixom.net> From: Eric Dumazet Date: Thu, 6 Sep 2018 12:33:58 -0700 Message-ID: Subject: Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables To: Olof Johansson Cc: David Miller , Neil Horman , Marcelo Ricardo Leitner , Vladislav Yasevich , Herbert Xu , Alexey Kuznetsov , Hideaki YOSHIFUJI , linux-crypto@vger.kernel.org, LKML , linux-sctp@vger.kernel.org, netdev , linux-decnet-user@lists.sourceforge.net, kernel-team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Please share some numbers with us.