Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: move sk_uid and sk_protocol to sock_read_tx

sk_uid and sk_protocol are read from inet6_csk_route_socket()
for each TCP transmit.

Also read from udpv6_sendmsg(), udp_sendmsg() and others.

Move them to sock_read_tx for better cache locality.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250919204856.2977245-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
17b14d23 4238cbf6

+5 -3
+3 -3
include/net/sock.h
··· 492 492 long sk_sndtimeo; 493 493 u32 sk_priority; 494 494 u32 sk_mark; 495 + kuid_t sk_uid; 496 + u16 sk_protocol; 497 + u16 sk_type; 495 498 struct dst_entry __rcu *sk_dst_cache; 496 499 netdev_features_t sk_route_caps; 497 500 #ifdef CONFIG_SOCK_VALIDATE_XMIT ··· 520 517 sk_no_check_tx : 1, 521 518 sk_no_check_rx : 1; 522 519 u8 sk_shutdown; 523 - u16 sk_type; 524 - u16 sk_protocol; 525 520 unsigned long sk_lingertime; 526 521 struct proto *sk_prot_creator; 527 522 rwlock_t sk_callback_lock; 528 523 int sk_err_soft; 529 524 u32 sk_ack_backlog; 530 525 u32 sk_max_ack_backlog; 531 - kuid_t sk_uid; 532 526 unsigned long sk_ino; 533 527 spinlock_t sk_peer_lock; 534 528 int sk_bind_phc;
+2
net/core/sock.c
··· 4471 4471 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_sndtimeo); 4472 4472 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_priority); 4473 4473 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_mark); 4474 + CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_uid); 4475 + CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_protocol); 4474 4476 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_dst_cache); 4475 4477 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_route_caps); 4476 4478 CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_gso_type);