Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Eric Dumazet
Sat, 14 Nov 2026 15:38
Re: [PATCH v1 net-next 7/8] tcp: Batch memory accounting in tcp_collapse().
Author: Eric Dumazet
Date: Sat, 14 Nov 2026 15:38
Date: Sat, 14 Nov 2026 15:38
24 lines
9743 bytes
9743 bytes
Le sam. 14 nov. 2026 ร 05:01, Kuniyuki Iwashima <kuniyu@google.com> a รฉcrit :
>
> Once tcp_collapse_one() calls sock_rfree(), skb->truesize is
> reclaimed to sk->sk_forward_alloc by sk_mem_uncharge().
>
> However, sk_mem_uncharge() rounds down sk->sk_forward_alloc
> immediately once it reaches 4K since commit 4890b686f408 ("net:
> keep sk->sk_forward_alloc as small as possible").
>
> This unnecessarily reclaims memory for newly allocated skbs,
> and the following skb_set_owner_r() for them underflows
> sk->sk_forward_alloc without sk_forced_mem_schedule().
>
> Let's cache the delta during tcp_collapse() and batch accounting
> at the end.
>
> Then, we no longer need sk_forced_mem_schedule(), and instead
> DEBUG_NET_WARN_ON_ONCE() is added to catch a future issue.
>
> 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