]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tcp: split tcp_check_space() in two parts
authorEric Dumazet <edumazet@google.com>
Tue, 3 Feb 2026 05:09:32 +0000 (05:09 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Feb 2026 04:37:06 +0000 (20:37 -0800)
commit309dd9942155c090b774cec29c5982922fece446
treebf5c471a2859aeafb0cab1b5dd893ff6feccdd78
parent7c1db78ff75f936e566f23af0e38ee4568a6af6b
tcp: split tcp_check_space() in two parts

tcp_check_space() is fat and not inlined.

Move its slow path in (out of line) __tcp_check_space()
and make tcp_check_space() an inline function for better TCP performance.

$ scripts/bloat-o-meter -t vmlinux.old vmlinux.new
add/remove: 2/2 grow/shrink: 4/0 up/down: 708/-582 (126)
Function                                     old     new   delta
__tcp_check_space                              -     521    +521
tcp_rcv_established                         1860    1916     +56
tcp_rcv_state_process                       3342    3384     +42
tcp_event_new_data_sent                      248     286     +38
tcp_data_snd_check                            71     106     +35
__pfx___tcp_check_space                        -      16     +16
__pfx_tcp_check_space                         16       -     -16
tcp_check_space                              566       -    -566
Total: Before=24896373, After=24896499, chg +0.00%

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260203050932.3522221-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tcp.h
net/ipv4/tcp_input.c