tcp: reorganize tcp_sock fast path variables
authorCoco Li <lixiaoyan@google.com>
Mon, 4 Dec 2023 20:12:31 +0000 (20:12 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 Dec 2023 04:16:05 +0000 (20:16 -0800)
commitd5fed5addb2b6bc13035de4338b7ea2052a2e006
treed8eff8b24b9e07bdc177d6a2f08684b3f0425b31
parent43a71cd66b9c0a4af3d15d8644359fde35bdbed0
tcp: reorganize tcp_sock fast path variables

The variables are organized according in the following way:

- TX read-mostly hotpath cache lines
- TXRX read-mostly hotpath cache lines
- RX read-mostly hotpath cache lines
- TX read-write hotpath cache line
- TXRX read-write hotpath cache line
- RX read-write hotpath cache line

Fastpath cachelines end after rcvq_space.

Cache line boundaries are enforced only between read-mostly and
read-write. That is, if read-mostly tx cachelines bleed into
read-mostly txrx cachelines, we do not care. We care about the
boundaries between read and write cachelines because we want
to prevent false sharing.

Fast path variables span cache lines before change: 12
Fast path variables span cache lines after change: 8

Suggested-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Wei Wang <weiwan@google.com>
Signed-off-by: Coco Li <lixiaoyan@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20231204201232.520025-3-lixiaoyan@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/tcp.h
net/ipv4/tcp.c