[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3887b08ac0e55e27a24d2f66afcfff1961ed9b13.camel@redhat.com>
Date: Tue, 09 May 2023 11:51:02 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Cathy Zhang <cathy.zhang@...el.com>, edumazet@...gle.com,
davem@...emloft.net, kuba@...nel.org
Cc: jesse.brandeburg@...el.com, suresh.srinivas@...el.com,
tim.c.chen@...el.com, lizhen.you@...el.com, eric.dumazet@...il.com,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next 1/2] net: Keep sk->sk_forward_alloc as a proper
size
On Sun, 2023-05-07 at 19:08 -0700, Cathy Zhang wrote:
> Before commit 4890b686f408 ("net: keep sk->sk_forward_alloc as small as
> possible"), each TCP can forward allocate up to 2 MB of memory and
> tcp_memory_allocated might hit tcp memory limitation quite soon. To
> reduce the memory pressure, that commit keeps sk->sk_forward_alloc as
> small as possible, which will be less than 1 page size if SO_RESERVE_MEM
> is not specified.
>
> However, with commit 4890b686f408 ("net: keep sk->sk_forward_alloc as
> small as possible"), memcg charge hot paths are observed while system is
> stressed with a large amount of connections. That is because
> sk->sk_forward_alloc is too small and it's always less than
> sk->truesize, network handlers like tcp_rcv_established() should jump to
> slow path more frequently to increase sk->sk_forward_alloc. Each memory
> allocation will trigger memcg charge, then perf top shows the following
> contention paths on the busy system.
>
> 16.77% [kernel] [k] page_counter_try_charge
> 16.56% [kernel] [k] page_counter_cancel
> 15.65% [kernel] [k] try_charge_memcg
I'm guessing you hit memcg limits frequently. I'm wondering if it's
just a matter of tuning/reducing tcp limits in
/proc/sys/net/ipv4/tcp_mem.
Cheers,
Paolo
Powered by blists - more mailing lists