From owner-cvs-src@FreeBSD.ORG Tue Aug 1 10:30:27 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FEB116A4DA; Tue, 1 Aug 2006 10:30:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3FA7543D5D; Tue, 1 Aug 2006 10:30:27 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k71AURDe064759; Tue, 1 Aug 2006 10:30:27 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k71AURni064758; Tue, 1 Aug 2006 10:30:27 GMT (envelope-from rwatson) Message-Id: <200608011030.k71AURni064758@repoman.freebsd.org> From: Robert Watson Date: Tue, 1 Aug 2006 10:30:26 +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_sockbuf.c uipc_socket.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: Tue, 01 Aug 2006 10:30:27 -0000 rwatson 2006-08-01 10:30:26 UTC FreeBSD src repository Modified files: sys/kern uipc_sockbuf.c uipc_socket.c sys/sys socketvar.h Log: Reimplement socket buffer tear-down in sofree(): as the socket is no longer referenced by other threads (hence our freeing it), we don't need to set the can't send and can't receive flags, wake up the consumers, perform two levels of locking, etc. Implement a fast-path teardown, sbdestroy(), which flushes and releases each socket buffer. A manual dom_dispose of the receive buffer is still required explicitly to GC any in-flight file descriptors, etc, before flushing the buffer. This results in a 9% UP performance improvement and 16% SMP performance improvement on a tight loop of socket();close(); in micro-benchmarking, but will likely also affect CPU-bound macro-benchmark performance. Revision Changes Path 1.163 +53 -13 src/sys/kern/uipc_sockbuf.c 1.276 +22 -14 src/sys/kern/uipc_socket.c 1.154 +1 -0 src/sys/sys/socketvar.h