Re: [PATCH net-next] net: init sk_cookie for inet socket

From: Eric Dumazet
Date: Tue Apr 24 2018 - 08:37:23 EST




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)