* [PATCH net-next] tcp: move tp->chrono_type next tp->chrono_stat[]
@ 2026-03-08 12:23 Eric Dumazet
2026-03-08 16:26 ` Neal Cardwell
2026-03-10 3:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2026-03-08 12:23 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Neal Cardwell, Kuniyuki Iwashima, netdev,
eric.dumazet, Eric Dumazet
chrono_type is currently in tcp_sock_read_txrx group, which
is supposed to hold read-mostly fields.
But chrono_type is mostly written in tx path, it should
be moved to tcp_sock_write_tx group, close to other
chrono fields (chrono_stat[], chrono_start).
Note this adds holes, but data locality is far more important.
Use a full u8 for the time being, compiler can generate
more efficient code.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/tcp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index f72eef31fa23cc584f2f0cefacdc35cae43aa52d..c44cf9ae8d16f5cc7808a6ca78c1dad03354dccf 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -228,8 +228,7 @@ struct tcp_sock {
u32 sacked_out; /* SACK'd packets */
u16 tcp_header_len; /* Bytes of tcp header to send */
u8 scaling_ratio; /* see tcp_win_from_space() */
- u8 chrono_type : 2, /* current chronograph type */
- repair : 1,
+ u8 repair : 1,
tcp_usec_ts : 1, /* TSval values in usec */
is_sack_reneg:1, /* in recovery from loss with SACK reneg? */
is_cwnd_limited:1,/* forward progress limited by snd_cwnd? */
@@ -264,6 +263,7 @@ struct tcp_sock {
* total number of data bytes sent.
*/
u32 snd_sml; /* Last byte of the most recently transmitted small packet */
+ u8 chrono_type; /* current chronograph type */
u32 chrono_start; /* Start time in jiffies of a TCP chrono */
u32 chrono_stat[3]; /* Time in jiffies for chrono_stat stats */
u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
--
2.53.0.473.g4a7958ca14-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: move tp->chrono_type next tp->chrono_stat[]
2026-03-08 12:23 [PATCH net-next] tcp: move tp->chrono_type next tp->chrono_stat[] Eric Dumazet
@ 2026-03-08 16:26 ` Neal Cardwell
2026-03-10 3:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Neal Cardwell @ 2026-03-08 16:26 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
Kuniyuki Iwashima, netdev, eric.dumazet
n Sun, Mar 8, 2026 at 8:23 AM Eric Dumazet <edumazet@google.com> wrote:
>
> chrono_type is currently in tcp_sock_read_txrx group, which
> is supposed to hold read-mostly fields.
>
> But chrono_type is mostly written in tx path, it should
> be moved to tcp_sock_write_tx group, close to other
> chrono fields (chrono_stat[], chrono_start).
>
> Note this adds holes, but data locality is far more important.
>
> Use a full u8 for the time being, compiler can generate
> more efficient code.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Thanks, Eric!
neal
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: move tp->chrono_type next tp->chrono_stat[]
2026-03-08 12:23 [PATCH net-next] tcp: move tp->chrono_type next tp->chrono_stat[] Eric Dumazet
2026-03-08 16:26 ` Neal Cardwell
@ 2026-03-10 3:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-10 3:00 UTC (permalink / raw)
To: Eric Dumazet
Cc: davem, kuba, pabeni, horms, ncardwell, kuniyu, netdev,
eric.dumazet
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sun, 8 Mar 2026 12:23:02 +0000 you wrote:
> chrono_type is currently in tcp_sock_read_txrx group, which
> is supposed to hold read-mostly fields.
>
> But chrono_type is mostly written in tx path, it should
> be moved to tcp_sock_write_tx group, close to other
> chrono fields (chrono_stat[], chrono_start).
>
> [...]
Here is the summary with links:
- [net-next] tcp: move tp->chrono_type next tp->chrono_stat[]
https://git.kernel.org/netdev/net-next/c/4b78c9cbd8f1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-10 3:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-08 12:23 [PATCH net-next] tcp: move tp->chrono_type next tp->chrono_stat[] Eric Dumazet
2026-03-08 16:26 ` Neal Cardwell
2026-03-10 3:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox