Skip to contentSkip to conversation

tcp: clarify comment for mdev_us in struct tcp_sock

PATCH Applied Ziran Zhang 3 participants 3 messages Aug 5 – Aug 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: clarify comment for mdev_us in struct tcp_sock

The existing comment for mdev_us says "medium deviation", but this term is inaccurate. The field stores the "mean deviation" of RTT, as originally defined in Van Jacobson's paper "Congestion Avoidance and Control", and it is scaled by 4 (<< 2) in the Linux implementation.

Update the comment to reflect the correct terminology and storage format.

---
 include/linux/tcp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/tcp.h +1 -1
index 8a6807082..6a8c77719 100644
@@ -274,7 +274,7 @@ struct tcp_sock {
 	u32	write_seq;	/* Tail(+1) of data held in tcp send buffer */
 	u32	pushed_seq;	/* Last pushed seq, required to talk to windows */
 	u32	lsndtime;	/* timestamp of last sent data packet (for restart window) */
-	u32	mdev_us;	/* medium deviation			*/
+	u32	mdev_us;	/* mean deviation of RTT, scaled by 4 (<< 2) in usecs */
 	u32	rtt_seq;	/* sequence number to update rttvar	*/
 	u32	max_packets_out;  /* max packets_out in last window */
 	u32	cwnd_usage_seq;  /* right edge of cwnd usage tracking flight */
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Ziran Zhang

The existing comment for mdev_us says "medium deviation", but this term is inaccurate. The field stores the "mean deviation" of RTT, as originally defined in Van Jacobson's paper "Congestion Avoidance and Control", and it is scaled by 4 (<< 2) in the Linux implementation.

Update the comment to reflect the correct terminology and storage format.

Thanks!

#2 lore raw
In reply to Ziran Zhang
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Wed, 5 Aug 2026 21:19:27 +0800 you wrote:

The existing comment for mdev_us says "medium deviation", but this term is inaccurate. The field stores the "mean deviation" of RTT, as originally defined in Van Jacobson's paper "Congestion Avoidance and Control", and it is scaled by 4 (<< 2) in the Linux implementation.

Update the comment to reflect the correct terminology and storage format.

[...]

Here is the summary with links:
- tcp: clarify comment for mdev_us in struct tcp_sock

    https://git.kernel.org/netdev/net-next/c/9b20885f1472

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html