Received: by 10.192.165.148 with SMTP id m20csp4733025imm; Tue, 24 Apr 2018 07:35:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/RCtJhkFKL3oMhALTctjn5s3Cy1tIHIWbtM3/IllMGH2QL1hZX6919J56KsQLBT9Jz+DjL X-Received: by 10.99.42.206 with SMTP id q197mr20859422pgq.60.1524580511079; Tue, 24 Apr 2018 07:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524580511; cv=none; d=google.com; s=arc-20160816; b=UhcxMfJ/EdSEienznVtspTIazExjO/fkGZp6nZtO82IZZL7T1NRIgk4vOyD4yX7hU+ dZMJPwuhKTrswYsEkrg+S0CdDYyLlst04fpnNlpY4PpYLrpn4nUh3NH/sd/U/GJjiNO0 ro/7HR4Ank3bbSi1IjVJxFTCNoBhZcqrit1jgow0OyLKrZeICE6dMwkCkhvaddxxpgU9 51VZ4tX4znqvQxVRS9AywElt41W/QOwaT9OQxqXnYo+mGECZHUOSahdBYZSg5V/wFjLz wNf4gvTRYZVwAyg1SqkqZyK8P9lRqKEX14Kq4XwLcPXKPKNmAdw9xryYuXttZaz1GuhU LZTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Ic534DYztOu/CG1v8PUAhvbf98Z4iuZ0+K9z9uwenE8=; b=bzHaBAAymEy7sKBixIW0ew78h+dvcUsaaHgu1nZDaL7n8ec3P9CwocJg8t1dSssgTL pCIMpDd2YFFL/3i/Wi6MsTDXdwF31jErTu9OByhJRede+jbSx2A9HAuwNexa6K+TbPXf y4n5GcgutW8RJDu6mPXBeEBQc6GBlrYnu7IU/ovvbm76xCIMEfPfSxZnMf06A56K9NLn 3gLBMVlKMN/zJCe45bZ+n3/YK3LWmijd92V1hIiUoddiAqgIstUjmN88euOcKHPm/ZWf GU+PhRcx9+MnJdMSx3T0Uryuv5Iif9HRX8Fcz37y13IU+jM+Ml8R6Ig0lWD9UI3a36HY vKGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U84feM8a; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l27si13870386pfb.69.2018.04.24.07.34.56; Tue, 24 Apr 2018 07: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U84feM8a; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757508AbeDXMhT (ORCPT + 99 others); Tue, 24 Apr 2018 08:37:19 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:40652 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbeDXMhP (ORCPT ); Tue, 24 Apr 2018 08:37:15 -0400 Received: by mail-pg0-f68.google.com with SMTP id e9so10773396pgr.7; Tue, 24 Apr 2018 05:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Ic534DYztOu/CG1v8PUAhvbf98Z4iuZ0+K9z9uwenE8=; b=U84feM8aK+N8PwtDtnIIgQiX4G8CJucMHNWiGqtvS+81c0doXvBmN5W4oqqWY/n4Ip SYTgh8/lUcsCbAtc0LeH1XESsxooMmPTZ6XRGUK8a61ilSRnhKxRMjJBkZPVXSm8dgbz nSfC2lk2ZukP90hQAW2sqnP08//VbkOrd3rO0iswQs6aC2XXHkIuuvZzJ0m0lrEIH/Xq hpT8avtA29gMYTHKr5zRfgkRWe1WV2rBcbHT6YcMj2utq2+bpQ70w0l/fgeyEWv5biji NSmFvh0y7Q3Un8w3G/xbLXnZIdE/upXpkyifZ/3imNKYL9mf1UDxkAc1dhJueMJD/ZUq o6fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ic534DYztOu/CG1v8PUAhvbf98Z4iuZ0+K9z9uwenE8=; b=c0UNWTLOIGN+YB44H3xdKBJghuPNo3uOOZVrGwt/2Nqr8ucuO8jAbge0qOnUc4yikA 4H3CnkD8/Lozp50Gb8mmL7tePOXByriScE/yQ3nxWCUtmUQ000K04bmI8wnkFCuQUiTZ 6uuXFMu7MPu6K2ZBqcchlD8u/dnzAoFCBgPbIHgQ5Xc5UQo8eB9+KrCz5ozEmNMRlvc9 gAe1LUtE3wejXfOjWe+PadDu23NX0oS4fCYcZccIbJq0EYbtc/igjX463u0VoQr3XB8A aGrDX4PU42EtENRtI1m6GmI1CQFkjtZDSG8ZhU68LirGCio1ScVXPQ4g670R26FxFjvy 5Q4g== X-Gm-Message-State: ALQs6tBzb3fA0b2Thza7NJPq6vN6D7SbVu+HskWfckNPjt2ADJTBOlnJ sC11DhZqYUK+Q+mekJCujN/J4emE X-Received: by 10.98.247.17 with SMTP id h17mr23382124pfi.165.1524573435071; Tue, 24 Apr 2018 05:37:15 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id h8sm11531993pgq.56.2018.04.24.05.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 05:37:14 -0700 (PDT) Subject: Re: [PATCH net-next] net: init sk_cookie for inet socket To: Yafang Shao Cc: David Miller , Alexei Starovoitov , netdev@vger.kernel.org, LKML References: <1524405004-10960-1-git-send-email-laoar.shao@gmail.com> <20180423.115821.640630949143585629.davem@davemloft.net> <788ce3f1-6534-5c2e-1870-5ebd8ea4ae7f@gmail.com> <67a158d9-cd33-8c28-39c3-9cead4107205@gmail.com> From: Eric Dumazet Message-ID: <45bfd7ce-ecfa-8a4d-b1ed-8914a6b90093@gmail.com> Date: Tue, 24 Apr 2018 05:37:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/24/2018 04:47 AM, Yafang Shao wrote: > > Could you pls. explain the issue to me ? Just run a synflood test on your host, it will definitely show the atomic consuming most cpu cycles in inet_reqsk_alloc(), because of huge contention on a cache line shared by all cpus. Performance is reduced from ~5 Mpps to ~3.8 Mpps with 16 RX queues on my host. atomic64_inc_return(&sock_net(sk)->cookie_gen) was not meant to be used in the normal case (when a socket cookie is not ever requested/needed)