From owner-svn-src-head@FreeBSD.ORG Thu Aug 25 09:20:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 743C21065670; Thu, 25 Aug 2011 09:20:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6038FC0C; Thu, 25 Aug 2011 09:20:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7P9KESw095796; Thu, 25 Aug 2011 09:20:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7P9KECb095791; Thu, 25 Aug 2011 09:20:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201108250920.p7P9KECb095791@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 25 Aug 2011 09:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225169 - in head/sys: kern netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2011 09:20:14 -0000 Author: bz Date: Thu Aug 25 09:20:13 2011 New Revision: 225169 URL: http://svn.freebsd.org/changeset/base/225169 Log: Increase the defaults for the maximum socket buffer limit, and the maximum TCP send and receive buffer limits from 256kB to 2MB. For sb_max_adj we need to add the cast as already used in the sysctl handler to not overflow the type doing the maths. Note that this is just the defaults. They will allow more memory to be consumed per socket/connection if needed but not change the default "idle" memory consumption. All values are still tunable by sysctls. Suggested by: gnn Discussed on: arch (Mar and Aug 2011) MFC after: 3 weeks Approved by: re (kib) Modified: head/sys/kern/uipc_sockbuf.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/kern/uipc_sockbuf.c Thu Aug 25 09:20:13 2011 (r225169) @@ -61,7 +61,7 @@ void (*aio_swake)(struct socket *, struc u_long sb_max = SB_MAX; u_long sb_max_adj = - SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */ + (quad_t)SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */ static u_long sb_efficiency = 8; /* parameter for sbreserve() */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/netinet/tcp_input.c Thu Aug 25 09:20:13 2011 (r225169) @@ -195,7 +195,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_autorcvbuf_inc), 0, "Incrementor step size of automatic receive buffer"); -VNET_DEFINE(int, tcp_autorcvbuf_max) = 256*1024; +VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024; #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/netinet/tcp_output.c Thu Aug 25 09:20:13 2011 (r225169) @@ -117,7 +117,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_autosndbuf_inc), 0, "Incrementor step size of automatic send buffer"); -VNET_DEFINE(int, tcp_autosndbuf_max) = 256*1024; +VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024; #define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_max), 0, Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Thu Aug 25 08:47:38 2011 (r225168) +++ head/sys/sys/sockbuf.h Thu Aug 25 09:20:13 2011 (r225169) @@ -37,7 +37,7 @@ #include #include -#define SB_MAX (256*1024) /* default for max chars in sockbuf */ +#define SB_MAX (2*1024*1024) /* default for max chars in sockbuf */ /* * Constants for sb_flags field of struct sockbuf.