From patchwork Fri Nov 29 01:10:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 36371 X-Patchwork-Delegate: carlos@redhat.com Received: (qmail 36935 invoked by alias); 29 Nov 2019 01:10:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 36921 invoked by uid 89); 29 Nov 2019 01:10:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1220, listen X-HELO: esa2.mentor.iphmx.com IronPort-SDR: S4VAsxI6lFJTo6Knr0wTwPnb2K5vi2/uBld3BpSMoLpI3VHsn4WXiVVIe8eVd1TbeYgo28HSI2 SHqjnuaqCd1xucnDZ/D/N5o/wGhr/zTCY6Odfh/44OghF6ilgbXr8jlPgxnXwA5viiZr3L495s 99AEDt7oz24zj5MolSYdd6n78xJfWYVyB9eWd9bEJqluCR6GIu84/XBbgTLZTmaL8yQrjxjsry mZsDVf4Bag97LIGDSEAfTqk3T1rOhT3qbQNRtHgFkwlijV95tN6LuL7YyjTnqVwjtuVHF8p3vw M6M= IronPort-SDR: LdRluSc/PCnHsVWm5bNiKrshatJLx2V7EeG+dvz7t8ZrHtaIU8H1J2iuqyVf5FVbiL7DZ0ow8S feQ45lyMyd0lEMim9hHNnqOd5pQ71mnaBnu+V3P66yjlUtbRRfL/Ci4YmasbztlC0R7dxNnkMM uFkUZ22Hl2WF4P3agYxZzCp+YT/SvxveE4nZBzcib13X3TGT0+AktXxKK5QhzS8cziOZ8ZJsT2 XZXpFX9BHyUvxtJXfoQD2onk+t1tkMLeDEoP3W6HzZE1EEUkkxZArHBRgBdNis2DbZHFkDQsbC Qi4= Date: Fri, 29 Nov 2019 01:10:19 +0000 From: Joseph Myers To: Subject: Update SOMAXCONN value from Linux 5.4 Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Return-Path: joseph@codesourcery.com Linux 5.4 changes the SOMAXCONN value from 128 to 4096 (this isn't in a uapi header; various constants related to the kernel/userspace interface, including this one, are in the non-uapi linux/socket.h header). This patch increases the value in glibc. As I understand it, it is safe to use a higher value even with older kernels (the kernel will simply adjust the value passed to listen to be no more than the value supported in the kernel), and SOMAXCONN is actually only a default for a sysctl value in the kernel that can be changed at runtime. So I think updating the value in glibc is a reasonable and safe thing to do. Tested for x86_64. Reviewed-by: Carlos O'Donell diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index 3e88d66328..7537a7e86b 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -169,7 +169,7 @@ typedef __socklen_t socklen_t; #define SOL_XDP 283 /* Maximum queue length specifiable by listen. */ -#define SOMAXCONN 128 +#define SOMAXCONN 4096 /* Get the definition of the macro to define the common sockaddr members. */ #include