Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Tue, 17 Nov 2026 23:13
Re: [PATCH v2 net-next 2/7] tcp: Don't collapse high density skb.
Author: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 23:13
Date: Tue, 17 Nov 2026 23:13
66 lines
10122 bytes
10122 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message describes a real regression, but the patch has
no Fixes: tag.
--
tcp: Don't collapse high density skb.
This patch caps the scaling_ratio that tcp_collapse() uses at the highest
ratio a collapsed skb can reach (222 with 4K pages). It also changes the
bloat check so it only looks at the bytes left unread after start. With
this, tcp_collapse() no longer collapses an skb it just produced, and it
no longer collapses a dense GRO skb just because a few bytes of it were
read.
> If 4K-MSS GRO skb updates tp->scaling_ratio, it can be larger
> than 222.
>
> Then, even the newly collapsed skb could be detected as bloated
> by the next tcp_collapse().
[Severity: Low]
This describes a regression in tcp_collapse(). Should the patch carry a
Fixes: tag?
The re-collapse seems to have become possible with commit dfa2f0483360
("tcp: get rid of sysctl_tcp_adv_win_scale"). That commit made
tcp_win_from_space() use the per-socket scaling_ratio. For dense skbs,
tcp_measure_rcv_mss() can raise that ratio as high as 255:
net/ipv4/tcp_input.c:tcp_measure_rcv_mss() {
...
u64 val = (u64)skb->len << TCP_RMEM_TO_WIN_SCALE;
...
do_div(val, skb->truesize);
tcp_sk(sk)->scaling_ratio = val ? val : 1;
...
}
Take a full collapsed skb (len 3776, truesize 4352) and a ratio of 230.
The old check in tcp_collapse() gives 4352 * 230 >> 8 = 3910, which is
greater than 3776. So the skb counts as bloated and is copied again on
every prune.
Before dfa2f0483360, the default adv_win_scale=1 reduced the check to
truesize / 2 > len. That gives 2176 > 3776, which is false, so collapsed
skbs never matched.
Documentation/process/maintainer-netdev.rst says the Fixes: tag is
required for fixes, regardless of the tree. Would adding the following
help with tracking?
Fixes: dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale")
If the patch is meant only as a heuristic improvement for net-next, could
the commit message say that?
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116230555.2305867-1-kuniyu%40google.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads