]> git.ipfire.org Git - thirdparty/linux.git/commit
tcp: reduce calls to tcp_schedule_loss_probe()
authorEric Dumazet <edumazet@google.com>
Mon, 23 Feb 2026 11:35:01 +0000 (11:35 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Feb 2026 01:44:33 +0000 (17:44 -0800)
commitfca59a2dd0b8ce55ad090707ec425d6d37b8b932
treef575b98517ef2ecab8e330b4433153b1b772cb23
parenta09eb622f383e6ceff7d55072cba4d4b8234d5d5
tcp: reduce calls to tcp_schedule_loss_probe()

For RPC workloads, we alternate tcp_schedule_loss_probe() calls from
output path and from input path, with tp->packets_out value
oscillating between !zero and zero, leading to poor branch prediction.

Move tp->packets_out check from tcp_schedule_loss_probe() to
tcp_set_xmit_timer().

We avoid one call to tcp_schedule_loss_probe() from tcp_ack()
path for typical RPC workloads, while improving branch prediction.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260223113501.4070245-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c