Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Eric Dumazet
Sat, 14 Nov 2026 15:37
Re: [PATCH v1 net-next 6/8] tcp: Allocate all new skb before collapsing.
Author: Eric Dumazet
Date: Sat, 14 Nov 2026 15:37
Date: Sat, 14 Nov 2026 15:37
37 lines
10295 bytes
10295 bytes
Le sam. 14 nov. 2026 ร 05:01, Kuniyuki Iwashima <kuniyu@google.com> a รฉcrit : > > At the final stage, tcp_collapse() iterates over collapsible > candidate skbs and repacks them to new skbs. > > In each iteration, a new skb is allocated and inserted to the > receive queue or a temporary list for RB tree. > > If alloc_skb() fails while splitting a large bloated skb across > multiple new skbs, the partially-copied skb is not removed and > new skbs remain in the queue as duplicates, consuming more memory. > > It is only when all candidates are properly collapsed that > we can save memory. > > To avoid complicated rollback, let's preallocate skbs before > collapsing. > > Now all skb in [start, sub_end) must be allocated in a batch, > so the section size is normally capped at TCP_COLLAPSE_MAX_TOTAL_SIZE > (16 skbs), except when a single bloated skb or overlapping OOO skbs > must be collapsed together to free the original skb or keep the > rbtree monotonic. > > Once the size exceeds the limit, the remaining skbs are re-evaluated > from restart:. > > Note that the next skb can be skipped if its density already meets > tp->scaling_ratio, and each cut adds at most one remainder skb > (~3.4% worst-case truesize overhead on 4 KiB pages), which is a > small tradeoff to bound the temporary allocation. > > Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Reviewed-by: Eric Dumazet <edumazet@kernel.org>
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