summaryrefslogtreecommitdiff
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-12-14 13:48:59 +0300
committerDavid S. Miller <davem@davemloft.net>2023-12-15 14:01:26 +0300
commit4944566706b27918ca15eda913889db296792415 (patch)
tree1e160c6b6ecaa5d209620e62a1a9f6a562de37aa /net/core/sock.c
parente16064c9af7fe5a2220f7ad5f9be6fd7516e427c (diff)
downloadlinux-4944566706b27918ca15eda913889db296792415.tar.xz
net: increase optmem_max default value
For many years, /proc/sys/net/core/optmem_max default value on a 64bit kernel has been 20 KB. Regular usage of TCP tx zerocopy needs a bit more. Google has used 128KB as the default value for 7 years without any problem. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index fef349dd72fa..08ecdc68d2df 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -283,8 +283,10 @@ EXPORT_SYMBOL(sysctl_rmem_max);
__u32 sysctl_wmem_default __read_mostly = SK_WMEM_MAX;
__u32 sysctl_rmem_default __read_mostly = SK_RMEM_MAX;
-/* Maximal space eaten by iovec or ancillary data plus some space */
-int sysctl_optmem_max __read_mostly = sizeof(unsigned long)*(2*UIO_MAXIOV+512);
+/* Limits per socket sk_omem_alloc usage.
+ * TCP zerocopy regular usage needs 128 KB.
+ */
+int sysctl_optmem_max __read_mostly = 128 * 1024;
EXPORT_SYMBOL(sysctl_optmem_max);
int sysctl_tstamp_allow_data __read_mostly = 1;