[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161207.104747.1515574562496806645.davem@davemloft.net>
Date: Wed, 07 Dec 2016 10:47:47 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: pabeni@...hat.com, netdev@...r.kernel.org, willemb@...gle.com
Subject: Re: [PATCH net-next] net: sock_rps_record_flow() is for connected
sockets
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Tue, 06 Dec 2016 19:32:50 -0800
> From: Eric Dumazet <edumazet@...gle.com>
>
> Paolo noticed a cache line miss in UDP recvmsg() to access
> sk_rxhash, sharing a cache line with sk_drops.
>
> sk_drops might be heavily incremented by cpus handling a flood targeting
> this socket.
>
> We might place sk_drops on a separate cache line, but lets try
> to avoid wasting 64 bytes per socket just for this, since we have
> other bottlenecks to take care of.
>
> sock_rps_record_flow() should only access sk_rxhash for connected
> flows.
>
> Testing sk_state for TCP_ESTABLISHED covers most of the cases for
> connected sockets, for a zero cost, since system calls using
> sock_rps_record_flow() also access sk->sk_prot which is on the
> same cache line.
>
> A follow up patch will provide a static_key (Jump Label) since most
> hosts do not even use RFS.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Reported-by: Paolo Abeni <pabeni@...hat.com>
Applied, thanks Eric.
Powered by blists - more mailing lists