From owner-cvs-src@FreeBSD.ORG Thu May 3 14:42:42 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3F0A16A401; Thu, 3 May 2007 14:42:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id B415313C458; Thu, 3 May 2007 14:42:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l43EggKZ064070; Thu, 3 May 2007 14:42:42 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l43Egggi064069; Thu, 3 May 2007 14:42:42 GMT (envelope-from rwatson) Message-Id: <200705031442.l43Egggi064069@repoman.freebsd.org> From: Robert Watson Date: Thu, 3 May 2007 14:42:42 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern uipc_debug.c uipc_sockbuf.c uipc_socket.c uipc_syscalls.c src/sys/netinet sctputil.c src/sys/sys socketvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2007 14:42:42 -0000 rwatson 2007-05-03 14:42:42 UTC FreeBSD src repository Modified files: sys/kern uipc_debug.c uipc_sockbuf.c uipc_socket.c uipc_syscalls.c sys/netinet sctputil.c sys/sys socketvar.h Log: sblock() implements a sleep lock by interlocking SB_WANT and SB_LOCK flags on each socket buffer with the socket buffer's mutex. This sleep lock is used to serialize I/O on sockets in order to prevent I/O interlacing. This change replaces the custom sleep lock with an sx(9) lock, which results in marginally better performance, better handling of contention during simultaneous socket I/O across multiple threads, and a cleaner separation between the different layers of locking in socket buffers. Specifically, the socket buffer mutex is now solely responsible for serializing simultaneous operation on the socket buffer data structure, and not for I/O serialization. While here, fix two historic bugs: (1) a bug allowing I/O to be occasionally interlaced during long I/O operations (discovere by Isilon). (2) a bug in which failed non-blocking acquisition of the socket buffer I/O serialization lock might be ignored (discovered by sam). SCTP portion of this patch submitted by rrs. Revision Changes Path 1.2 +0 -8 src/sys/kern/uipc_debug.c 1.169 +16 -19 src/sys/kern/uipc_sockbuf.c 1.298 +68 -61 src/sys/kern/uipc_socket.c 1.254 +0 -4 src/sys/kern/uipc_syscalls.c 1.24 +10 -15 src/sys/netinet/sctputil.c 1.158 +4 -22 src/sys/sys/socketvar.h