linux-stable/net/sctp
Eric Dumazet 4890b686f4 net: keep sk->sk_forward_alloc as small as possible
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.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-06-10 16:21:27 -07:00
..
associola.c
auth.c
bind_addr.c
chunk.c
debug.c
diag.c sctp: fix kernel-infoleak for SCTP sockets 2022-03-10 14:46:42 -08:00
endpointola.c sctp: use call_rcu to free endpoint 2021-12-25 17:13:37 +00:00
input.c sctp: read sk->sk_bound_dev_if once in sctp_rcv() 2022-05-16 10:31:06 +01:00
inqueue.c
ipv6.c ipv6: Remove __ipv6_only_sock(). 2022-04-22 12:47:50 +01:00
Kconfig
Makefile
objcnt.c
offload.c
output.c net: allow gso_max_size to exceed 65536 2022-05-16 10:18:55 +01:00
outqueue.c sctp: count singleton chunks in assoc user stats 2022-04-05 09:51:12 +02:00
primitive.c
proc.c sctp: move hlist_node and hashent out of sctp_ep_common 2021-12-23 11:15:30 +00:00
protocol.c net: remove SK_MEM_QUANTUM and SK_MEM_QUANTUM_SHIFT 2022-06-10 16:21:26 -07:00
sm_make_chunk.c
sm_sideeffect.c sctp: check asoc strreset_chunk in sctp_generate_reconf_event 2022-04-23 22:34:17 +01:00
sm_statefuns.c net: keep sk->sk_forward_alloc as small as possible 2022-06-10 16:21:27 -07:00
sm_statetable.c
socket.c net: keep sk->sk_forward_alloc as small as possible 2022-06-10 16:21:27 -07:00
stream.c
stream_interleave.c net: keep sk->sk_forward_alloc as small as possible 2022-06-10 16:21:27 -07:00
stream_sched.c stcp: Use memset_after() to zero sctp_stream_out_ext 2022-05-20 17:42:53 -07:00
stream_sched_prio.c
stream_sched_rr.c
sysctl.c
transport.c sctp: make the raise timer more simple and accurate 2021-11-25 21:00:45 -08:00
tsnmap.c
ulpevent.c net: remove noblock parameter from recvmsg() entities 2022-04-12 15:00:25 +02:00
ulpqueue.c net: keep sk->sk_forward_alloc as small as possible 2022-06-10 16:21:27 -07:00