[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3029e92-4720-eb49-77e1-ca6fc0a855f3@linux.intel.com>
Date: Fri, 10 Jun 2022 16:00:51 -0700 (PDT)
From: Mat Martineau <mathew.j.martineau@...ux.intel.com>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev <netdev@...r.kernel.org>,
Soheil Hassas Yeganeh <soheil@...gle.com>,
Wei Wang <weiwan@...gle.com>,
Shakeel Butt <shakeelb@...gle.com>,
Neal Cardwell <ncardwell@...gle.com>,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next 6/7] net: keep sk->sk_forward_alloc as small as
possible
On Wed, 8 Jun 2022, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> Currently, tcp_memory_allocated can hit tcp_mem[] limits quite fast.
>
> Each TCP socket can forward allocate up to 2 MB of memory, even after
> flow became less active.
>
> 10,000 sockets can have reserved 20 GB of memory,
> and we have no shrinker in place to reclaim that.
>
> Instead of trying to reclaim the extra allocations in some places,
> just keep sk->sk_forward_alloc values as small as possible.
>
> This should not impact performance too much now we have per-cpu
> reserves: Changes to tcp_memory_allocated should not be too frequent.
>
> For sockets not using SO_RESERVE_MEM:
> - idle sockets (no packets in tx/rx queues) have zero forward alloc.
> - non idle sockets have a forward alloc smaller than one page.
>
> Note:
>
> - Removal of SK_RECLAIM_CHUNK and SK_RECLAIM_THRESHOLD
> is left to MPTCP maintainers as a follow up.
Yes, noted. Will be sure to clean this up.
Thanks Eric.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
> include/net/sock.h | 29 ++---------------------------
> net/core/datagram.c | 3 ---
> net/ipv4/tcp.c | 7 -------
> net/ipv4/tcp_input.c | 4 ----
> net/ipv4/tcp_timer.c | 19 ++++---------------
> net/iucv/af_iucv.c | 2 --
> net/mptcp/protocol.c | 2 +-
> net/sctp/sm_statefuns.c | 2 --
> net/sctp/socket.c | 5 -----
> net/sctp/stream_interleave.c | 2 --
> net/sctp/ulpqueue.c | 4 ----
> 11 files changed, 7 insertions(+), 72 deletions(-)
>
--
Mat Martineau
Intel
Powered by blists - more mailing lists