From nobody Fri Aug 22 16:22:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4c7lpN3d1Vz64Yy8; Fri, 22 Aug 2025 16:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c7lpN2wTTz3cp1; Fri, 22 Aug 2025 16:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755879756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqJKiPMX8pGWPDd8AMySSblqopagF0+Ur7jHAXMUJc0=; b=PWpKrv7QiH7lzv2V9ZjlOjXce7tTrPsA5A2Ztaejead8OitFPzEfEYQ/4IzjYJIN4r2xnt IPxLxmXZfnc1INY/5vAHPVGGV/ap4RcLpAzHfR+WKUKV6ehG+bi1fvi14AcyulT2XHwPZo 5wi+3zb4WKcDRM0IBjzk4Iko40hPeNtNeGSjtbUWTLiaxJIMfnybPk/rxhI4vFVqzfncYk PFyhI9H8qqC1zBGXhsCrLhWhj4xIsCK7Tq51QnfV0ti7hgy1he05uCb6mpuz1DZ0awUyA6 iDfRzJzARIDxGDv0emJTPyy8bP7Fbz70P2c8nW+YcPcj89fflDthMjhj5goStw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755879756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqJKiPMX8pGWPDd8AMySSblqopagF0+Ur7jHAXMUJc0=; b=tsLUiYEMe46H+fXf3jfRy3qQB3Fa5Lq36zijslW5v59iJXBNA8yGbDiuoL1pqjFlE2bqwv IiaJ8RPgArAQJPKWAw+jC1KbOZSp4eF//yOuNRlWCEzABsvGtziq3ZThjY5qwhm7BPtlWa 7G34a7wc/hMNsO10VE36ctaaZFcxNNNjyfMAgwVX3B2oYKvYK4FOtpxsEYbIFPuwjg7KYI FzkNoclMEDidhmNBPke6iKTZ3jFQmrTUK3GUeKAE+QTmsyQrbus9hLB5oFSzTwnEmNWEsF Z4KPafeOcvIl5g4zH1CW24fU/OJRcq12txzFKIqUcx/cctFQdimC95Wta3ZdBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755879756; a=rsa-sha256; cv=none; b=aSpJrcDySzH2LsWjBLK8xeJx9KNKna5aBj86yfDCEnSc3nBO2hIUSBSNRya2rGtMRVlQv1 rhjWbfrb28zOOt+xMGjPSuECMcwQx8vYiI5Do1lOi5Wsm3nQGCrxNlZhRsjoN+juaWHkVl EFut/NE/mCHnbuNeUdyTV5YrebvE7jcrqZx8Fx9wYVcuLw1kndStFG8Bs60jWG/GA1VGMx Jk+PEH79ibmX/jPWPrjcCg9qMLvY2Bsyjhzg3qwQoR4UDvujRorjvpUX5SQoKU+PILd9bn wD6gawgEts5hO5UFg66RYejz8iwxEDeBetxcqxgtLOKQEeWoya54ae0UFx50kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4c7lpN2QyNztb4; Fri, 22 Aug 2025 16:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57MGMaJG021832; Fri, 22 Aug 2025 16:22:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57MGMard021829; Fri, 22 Aug 2025 16:22:36 GMT (envelope-from git) Date: Fri, 22 Aug 2025 16:22:36 GMT Message-Id: <202508221622.57MGMard021829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 72ddb6de1028 - main - unix: increase net.local.(stream|seqpacket).(recv|send)space to 64 KiB List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72ddb6de1028426305df3ab6c81ff3834d5a69e5 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=72ddb6de1028426305df3ab6c81ff3834d5a69e5 commit 72ddb6de1028426305df3ab6c81ff3834d5a69e5 Author: Gleb Smirnoff AuthorDate: 2025-08-22 16:22:25 +0000 Commit: Gleb Smirnoff CommitDate: 2025-08-22 16:22:25 +0000 unix: increase net.local.(stream|seqpacket).(recv|send)space to 64 KiB The limit of 8 KiB comes straight from the 80-ies, when memory sizes were two orders of magnitude less. Microbenchmarking clearly shows that increased maximum buffer size is needed to improve bulk transfer performance over unix(4). Most operating system have larger default sizes. This brings us another reason for increase. A buggy application, that treats a stream socket as a datagram socket, shall work on Linux as long as its messages are smaller than socket buffer size without any issues 99.99% of time. But on FreeBSD it will instantly fail. In the ports system there are already applications that suggest increase of this sysctls for the application to work. We don't want to be a bug catcher for bad applications in the default configuration. Note that buffer size increase will not increase memory usage even on a system with a million unix(4) sockets at normal runtime, as long as applications are written properly and receivers drain their sockets and system has enough CPU time for them to do that. Reviewed by: peter.lei_ieee.org, rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D51903 --- sys/kern/uipc_usrreq.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0056dac65c7d..19870e989437 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -154,15 +154,12 @@ static struct task unp_defer_task; * and don't really want to reserve the sendspace. Their recvspace should be * large enough for at least one max-size datagram plus address. */ -#ifndef PIPSIZ -#define PIPSIZ 8192 -#endif -static u_long unpst_sendspace = PIPSIZ; -static u_long unpst_recvspace = PIPSIZ; +static u_long unpst_sendspace = 64*1024; +static u_long unpst_recvspace = 64*1024; static u_long unpdg_maxdgram = 8*1024; /* support 8KB syslog msgs */ static u_long unpdg_recvspace = 16*1024; -static u_long unpsp_sendspace = PIPSIZ; -static u_long unpsp_recvspace = PIPSIZ; +static u_long unpsp_sendspace = 64*1024; +static u_long unpsp_recvspace = 64*1024; static SYSCTL_NODE(_net, PF_LOCAL, local, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Local domain");