]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: move sk_dst_pending_confirm and sk_pacing_status to sock_read_tx group
authorEric Dumazet <edumazet@google.com>
Mon, 24 Nov 2025 17:50:11 +0000 (17:50 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 Nov 2025 03:28:29 +0000 (19:28 -0800)
These two fields are mostly read in TCP tx path, move them
in an more appropriate group for better cache locality.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20251124175013.1473655-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sock.h
net/core/sock.c

index 38d48cfe0741b9c2276d38d568390a11207e2310..a89aa97151f54b19bf1d0742a93ca1b10c8fd830 100644 (file)
@@ -481,8 +481,6 @@ struct sock {
                struct rb_root  tcp_rtx_queue;
        };
        struct sk_buff_head     sk_write_queue;
-       u32                     sk_dst_pending_confirm;
-       u32                     sk_pacing_status; /* see enum sk_pacing */
        struct page_frag        sk_frag;
        struct timer_list       sk_timer;
 
@@ -493,6 +491,8 @@ struct sock {
        __cacheline_group_end(sock_write_tx);
 
        __cacheline_group_begin(sock_read_tx);
+       u32                     sk_dst_pending_confirm;
+       u32                     sk_pacing_status; /* see enum sk_pacing */
        unsigned long           sk_max_pacing_rate;
        long                    sk_sndtimeo;
        u32                     sk_priority;
index b26a6cdc9bcda0892d5b5a538193bfb067295cdf..45c98bf524b284258f4b029f8f50258ada2919b7 100644 (file)
@@ -4519,14 +4519,14 @@ static int __init sock_struct_check(void)
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_send_head);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_write_queue);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_write_pending);
-       CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_dst_pending_confirm);
-       CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_pacing_status);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_frag);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_timer);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_pacing_rate);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_zckey);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_write_tx, sk_tskey);
 
+       CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_dst_pending_confirm);
+       CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_pacing_status);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_max_pacing_rate);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_sndtimeo);
        CACHELINE_ASSERT_GROUP_MEMBER(struct sock, sock_read_tx, sk_priority);