[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLQ1Sz7=sYMr=4r66-ZjHfnG5REi4uvitewfQrC7jrdZQ@mail.gmail.com>
Date: Tue, 20 Feb 2024 13:43:43 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, Willem de Bruijn <willemdebruijn.kernel@...il.com>,
"David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next] udp: add local "peek offset enabled" flag
On Tue, Feb 20, 2024 at 12:00 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> We want to re-organize the struct sock layout. The sk_peek_off
> field location is problematic, as most protocols want it in the
> RX read area, while UDP wants it on a cacheline different from
> sk_receive_queue.
>
> Create a local (inside udp_sock) copy of the 'peek offset is enabled'
> flag and place it inside the same cacheline of reader_queue.
>
> Check such flag before reading sk_peek_off. This will save potential
> false sharing and cache misses in the fast-path.
>
> Tested under UDP flood with small packets. The struct sock layout
> update causes a 4% performance drop, and this patch restores completely
> the original tput.
>
> Signed-off-by: Paolo Abeni <pabeni@...hat.com>
> ---
SGTM, thanks !
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists