From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next] net: init sk_cookie for inet socket Date: Tue, 24 Apr 2018 05:37:13 -0700 Message-ID: <45bfd7ce-ecfa-8a4d-b1ed-8914a6b90093@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: David Miller , Alexei Starovoitov , netdev@vger.kernel.org, LKML To: Yafang Shao Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.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)